@sparkleideas/plugin-neural-coordination 3.0.0-alpha.2
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/README.md +265 -0
- package/package.json +84 -0
package/README.md
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# @claude-flow/plugin-neural-coordination
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@claude-flow/plugin-neural-coordination)
|
|
4
|
+
[](https://github.com/ruvnet/claude-flow/blob/main/LICENSE)
|
|
5
|
+
[](https://www.npmjs.com/package/@claude-flow/plugin-neural-coordination)
|
|
6
|
+
|
|
7
|
+
A cutting-edge multi-agent coordination plugin combining the SONA self-optimizing neural architecture with graph neural networks for agent communication topology optimization. The plugin enables emergent protocol development, neural consensus mechanisms, collective memory formation, and adaptive swarm behavior while maintaining interpretability of agent interactions.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### npm
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @claude-flow/plugin-neural-coordination
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### CLI
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx claude-flow plugins install --name @claude-flow/plugin-neural-coordination
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { NeuralCoordinationPlugin } from '@claude-flow/plugin-neural-coordination';
|
|
27
|
+
|
|
28
|
+
// Initialize the plugin
|
|
29
|
+
const plugin = new NeuralCoordinationPlugin();
|
|
30
|
+
await plugin.initialize();
|
|
31
|
+
|
|
32
|
+
// Achieve consensus among agents
|
|
33
|
+
const consensus = await plugin.neuralConsensus({
|
|
34
|
+
proposal: {
|
|
35
|
+
topic: 'architecture-decision',
|
|
36
|
+
options: [
|
|
37
|
+
{ id: 'microservices', value: { pattern: 'microservices', complexity: 'high' } },
|
|
38
|
+
{ id: 'monolith', value: { pattern: 'monolith', complexity: 'low' } }
|
|
39
|
+
],
|
|
40
|
+
constraints: { maxLatency: 100, minReliability: 0.99 }
|
|
41
|
+
},
|
|
42
|
+
agents: [
|
|
43
|
+
{ id: 'architect', preferences: { scalability: 0.8, simplicity: 0.2 } },
|
|
44
|
+
{ id: 'ops', preferences: { scalability: 0.3, simplicity: 0.7 } },
|
|
45
|
+
{ id: 'developer', preferences: { scalability: 0.5, simplicity: 0.5 } }
|
|
46
|
+
],
|
|
47
|
+
protocol: 'iterative_refinement',
|
|
48
|
+
maxRounds: 10
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
console.log('Consensus reached:', consensus.decision);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Available MCP Tools
|
|
55
|
+
|
|
56
|
+
### 1. `coordination/neural-consensus`
|
|
57
|
+
|
|
58
|
+
Achieve agent consensus using neural negotiation protocols.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const result = await mcp.call('coordination/neural-consensus', {
|
|
62
|
+
proposal: {
|
|
63
|
+
topic: 'resource-allocation',
|
|
64
|
+
options: [
|
|
65
|
+
{ id: 'option-a', value: { cpus: 4, memory: '8GB' } },
|
|
66
|
+
{ id: 'option-b', value: { cpus: 8, memory: '4GB' } }
|
|
67
|
+
],
|
|
68
|
+
constraints: { budget: 100 }
|
|
69
|
+
},
|
|
70
|
+
agents: [
|
|
71
|
+
{ id: 'agent-1', preferences: { performance: 0.9 }, constraints: {} },
|
|
72
|
+
{ id: 'agent-2', preferences: { cost: 0.8 }, constraints: {} }
|
|
73
|
+
],
|
|
74
|
+
protocol: 'neural_voting',
|
|
75
|
+
maxRounds: 5
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Returns:** Consensus decision with voting breakdown, confidence scores, and round-by-round negotiation history.
|
|
80
|
+
|
|
81
|
+
### 2. `coordination/topology-optimize`
|
|
82
|
+
|
|
83
|
+
Optimize agent communication topology for efficiency using GNN analysis.
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
const result = await mcp.call('coordination/topology-optimize', {
|
|
87
|
+
agents: [
|
|
88
|
+
{ id: 'coordinator', capabilities: ['planning', 'delegation'], location: { zone: 'us-east' } },
|
|
89
|
+
{ id: 'worker-1', capabilities: ['coding'], location: { zone: 'us-east' } },
|
|
90
|
+
{ id: 'worker-2', capabilities: ['testing'], location: { zone: 'us-west' } }
|
|
91
|
+
],
|
|
92
|
+
objective: 'minimize_latency',
|
|
93
|
+
constraints: {
|
|
94
|
+
maxConnections: 10,
|
|
95
|
+
minRedundancy: 2,
|
|
96
|
+
preferredTopology: 'hybrid'
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Returns:** Optimized communication graph with connection weights and routing recommendations.
|
|
102
|
+
|
|
103
|
+
### 3. `coordination/collective-memory`
|
|
104
|
+
|
|
105
|
+
Manage shared collective memory across agent swarms.
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
const result = await mcp.call('coordination/collective-memory', {
|
|
109
|
+
action: 'store',
|
|
110
|
+
memory: {
|
|
111
|
+
key: 'project-context',
|
|
112
|
+
value: { requirements: [...], decisions: [...] },
|
|
113
|
+
importance: 0.9,
|
|
114
|
+
expiry: '2025-12-31T23:59:59Z'
|
|
115
|
+
},
|
|
116
|
+
scope: 'team',
|
|
117
|
+
consolidationStrategy: 'ewc'
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Returns:** Memory operation status with synchronization metadata across agents.
|
|
122
|
+
|
|
123
|
+
### 4. `coordination/emergent-protocol`
|
|
124
|
+
|
|
125
|
+
Develop emergent communication protocols through multi-agent reinforcement learning.
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
const result = await mcp.call('coordination/emergent-protocol', {
|
|
129
|
+
task: {
|
|
130
|
+
type: 'cooperative_search',
|
|
131
|
+
objectives: ['find_target', 'minimize_time'],
|
|
132
|
+
constraints: { maxSteps: 100 }
|
|
133
|
+
},
|
|
134
|
+
communicationBudget: {
|
|
135
|
+
symbolsPerMessage: 10,
|
|
136
|
+
messagesPerRound: 3
|
|
137
|
+
},
|
|
138
|
+
trainingEpisodes: 1000,
|
|
139
|
+
interpretability: true
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Returns:** Learned communication protocol with symbol vocabulary and usage patterns.
|
|
144
|
+
|
|
145
|
+
### 5. `coordination/swarm-behavior`
|
|
146
|
+
|
|
147
|
+
Orchestrate emergent swarm behaviors using neural coordination.
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
const result = await mcp.call('coordination/swarm-behavior', {
|
|
151
|
+
behavior: 'task_allocation',
|
|
152
|
+
parameters: {
|
|
153
|
+
taskQueue: [...],
|
|
154
|
+
priorityWeights: { urgency: 0.7, complexity: 0.3 }
|
|
155
|
+
},
|
|
156
|
+
adaptiveRules: true,
|
|
157
|
+
observability: {
|
|
158
|
+
recordTrajectories: true,
|
|
159
|
+
measureEmergence: true
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Returns:** Swarm behavior execution plan with agent assignments and adaptation metrics.
|
|
165
|
+
|
|
166
|
+
## Configuration Options
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
interface NeuralCoordinationConfig {
|
|
170
|
+
// Maximum number of agents in coordination (default: 1000)
|
|
171
|
+
maxAgents: number;
|
|
172
|
+
|
|
173
|
+
// Memory limit per agent (default: 1GB)
|
|
174
|
+
memoryLimitPerAgent: number;
|
|
175
|
+
|
|
176
|
+
// Consensus timeout per round in ms (default: 60000)
|
|
177
|
+
consensusTimeoutMs: number;
|
|
178
|
+
|
|
179
|
+
// Enable Byzantine fault tolerance (default: true)
|
|
180
|
+
enableBFT: boolean;
|
|
181
|
+
|
|
182
|
+
// Message signing for security (default: true)
|
|
183
|
+
signMessages: boolean;
|
|
184
|
+
|
|
185
|
+
// Supported consensus protocols
|
|
186
|
+
protocols: ('neural_voting' | 'iterative_refinement' | 'auction' | 'contract_net')[];
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Performance Targets
|
|
191
|
+
|
|
192
|
+
| Metric | Target | Improvement vs Baseline |
|
|
193
|
+
|--------|--------|------------------------|
|
|
194
|
+
| Consensus convergence (100 agents) | <100 rounds | 10x faster |
|
|
195
|
+
| Communication overhead | <10% of total compute | 3x reduction |
|
|
196
|
+
| Topology optimization (1000 nodes) | <1s | 60x faster |
|
|
197
|
+
| Memory synchronization | <100ms eventual consistency | 10x faster |
|
|
198
|
+
| Emergent protocol training | <1 hour for basic tasks | Novel capability |
|
|
199
|
+
|
|
200
|
+
## Security Considerations
|
|
201
|
+
|
|
202
|
+
- **Agent Authentication**: Every agent must be authenticated with signed credentials before joining coordination
|
|
203
|
+
- **Message Signing**: All inter-agent messages are cryptographically signed (Ed25519) to prevent spoofing
|
|
204
|
+
- **Byzantine Fault Tolerance**: Consensus tolerates up to f < n/3 malicious/faulty agents
|
|
205
|
+
- **Sybil Attack Prevention**: Agent credential verification and rate limiting prevent fake agent multiplication
|
|
206
|
+
- **Memory Encryption**: Collective memory is encrypted at rest (AES-256-GCM) with session-specific keys
|
|
207
|
+
- **Input Validation**: All inputs validated with Zod schemas to prevent injection attacks
|
|
208
|
+
|
|
209
|
+
### WASM Security Constraints
|
|
210
|
+
|
|
211
|
+
| Constraint | Value | Rationale |
|
|
212
|
+
|------------|-------|-----------|
|
|
213
|
+
| Memory Limit per Agent | 1GB max | Prevent resource exhaustion |
|
|
214
|
+
| CPU Time per Round | 60 seconds | Prevent consensus deadlock |
|
|
215
|
+
| No External Network | Enforced | Isolated agent communication only |
|
|
216
|
+
| Signed Messages | Ed25519 required | Prevent message tampering |
|
|
217
|
+
| Session Isolation | Per-coordination | Prevent cross-session leakage |
|
|
218
|
+
|
|
219
|
+
### Rate Limits
|
|
220
|
+
|
|
221
|
+
| Tool | Requests/Minute | Max Concurrent |
|
|
222
|
+
|------|-----------------|----------------|
|
|
223
|
+
| `neural-consensus` | 10 | 2 |
|
|
224
|
+
| `topology-optimize` | 5 | 1 |
|
|
225
|
+
| `collective-memory` | 100 | 10 |
|
|
226
|
+
| `emergent-protocol` | 1 | 1 |
|
|
227
|
+
| `swarm-behavior` | 10 | 2 |
|
|
228
|
+
|
|
229
|
+
### Input Limits
|
|
230
|
+
|
|
231
|
+
| Constraint | Limit |
|
|
232
|
+
|------------|-------|
|
|
233
|
+
| Max agents per coordination | 1,000 |
|
|
234
|
+
| Max message size | 1MB |
|
|
235
|
+
| Max rounds per consensus | 1,000 |
|
|
236
|
+
| Memory limit per agent | 1GB |
|
|
237
|
+
| CPU time per round | 60 seconds |
|
|
238
|
+
|
|
239
|
+
## Dependencies
|
|
240
|
+
|
|
241
|
+
- `sona` - Self-Optimizing Neural Architecture for agent adaptation
|
|
242
|
+
- `ruvector-gnn-wasm` - Communication graph optimization and message routing
|
|
243
|
+
- `ruvector-nervous-system-wasm` - Neural coordination layer for collective behavior
|
|
244
|
+
- `ruvector-attention-wasm` - Multi-head attention for agent-to-agent communication
|
|
245
|
+
- `ruvector-learning-wasm` - Multi-agent reinforcement learning (MARL)
|
|
246
|
+
|
|
247
|
+
## Use Cases
|
|
248
|
+
|
|
249
|
+
1. **Distributed Problem Solving**: Coordinate agents to solve complex decomposed problems
|
|
250
|
+
2. **Negotiation Systems**: Multi-party negotiation with optimal outcomes
|
|
251
|
+
3. **Swarm Robotics**: Emergent collective behaviors for physical agents
|
|
252
|
+
4. **Federated Learning**: Coordinate model training across distributed agents
|
|
253
|
+
5. **Market Simulation**: Agent-based modeling with realistic interactions
|
|
254
|
+
|
|
255
|
+
## Related Plugins
|
|
256
|
+
|
|
257
|
+
| Plugin | Description | Synergy |
|
|
258
|
+
|--------|-------------|---------|
|
|
259
|
+
| [@claude-flow/plugin-cognitive-kernel](https://www.npmjs.com/package/@claude-flow/plugin-cognitive-kernel) | Cognitive augmentation with working memory | Enhances individual agent reasoning within coordinated swarms |
|
|
260
|
+
| [@claude-flow/plugin-quantum-optimizer](https://www.npmjs.com/package/@claude-flow/plugin-quantum-optimizer) | Quantum-inspired optimization | Optimizes task allocation and resource scheduling across agents |
|
|
261
|
+
| [@claude-flow/plugin-hyperbolic-reasoning](https://www.npmjs.com/package/@claude-flow/plugin-hyperbolic-reasoning) | Hierarchical reasoning | Enables hierarchical agent organization and taxonomic coordination |
|
|
262
|
+
|
|
263
|
+
## License
|
|
264
|
+
|
|
265
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sparkleideas/plugin-neural-coordination",
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
|
+
"description": "Neural coordination plugin for multi-agent swarm intelligence using SONA, GNN, and attention mechanisms",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./tools": {
|
|
15
|
+
"import": "./dist/mcp-tools.js",
|
|
16
|
+
"types": "./dist/mcp-tools.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./bridges": {
|
|
19
|
+
"import": "./dist/bridges/index.js",
|
|
20
|
+
"types": "./dist/bridges/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./types": {
|
|
23
|
+
"import": "./dist/types.js",
|
|
24
|
+
"types": "./dist/types.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"plugin.yaml"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc",
|
|
34
|
+
"dev": "tsc --watch",
|
|
35
|
+
"clean": "rimraf dist",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"test:watch": "vitest",
|
|
38
|
+
"lint": "eslint src --ext .ts",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"prepublishOnly": "npm run clean && npm run build && npm run typecheck"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"claude-flow",
|
|
44
|
+
"neural-coordination",
|
|
45
|
+
"multi-agent",
|
|
46
|
+
"swarm",
|
|
47
|
+
"consensus",
|
|
48
|
+
"topology",
|
|
49
|
+
"sona",
|
|
50
|
+
"gnn",
|
|
51
|
+
"attention"
|
|
52
|
+
],
|
|
53
|
+
"author": "Claude Flow Team",
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/ruvnet/claude-flow.git",
|
|
58
|
+
"directory": "v3/plugins/neural-coordination"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"zod": "^3.22.4"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@types/node": "^20.10.0",
|
|
65
|
+
"rimraf": "^5.0.5",
|
|
66
|
+
"typescript": "^5.3.0",
|
|
67
|
+
"vitest": "^4.0.16"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@sparkleideas/ruvector-upstream": "*"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"@claude-flow/ruvector-upstream": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=18.0.0"
|
|
79
|
+
},
|
|
80
|
+
"publishConfig": {
|
|
81
|
+
"access": "public",
|
|
82
|
+
"tag": "v3alpha"
|
|
83
|
+
}
|
|
84
|
+
}
|