mcp-swarm 1.0.0 → 1.0.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 +188 -394
- package/README.ru.md +883 -1151
- package/dist/serverSmart.js +4 -3
- package/dist/serverSmart.js.map +1 -1
- package/dist/smartTools/analytics.js +161 -244
- package/dist/smartTools/analytics.js.map +1 -1
- package/dist/smartTools/collaboration.js +55 -112
- package/dist/smartTools/collaboration.js.map +1 -1
- package/dist/smartTools/core.js +32 -71
- package/dist/smartTools/core.js.map +1 -1
- package/dist/smartTools/files.js +37 -79
- package/dist/smartTools/files.js.map +1 -1
- package/dist/smartTools/git.js +14 -35
- package/dist/smartTools/git.js.map +1 -1
- package/dist/smartTools/index.js +77 -44
- package/dist/smartTools/index.js.map +1 -1
- package/dist/smartTools/infra.js +337 -776
- package/dist/smartTools/infra.js.map +1 -1
- package/dist/smartTools/intelligence.js +201 -443
- package/dist/smartTools/intelligence.js.map +1 -1
- package/dist/smartTools/security.js +90 -146
- package/dist/smartTools/security.js.map +1 -1
- package/dist/smartTools/tasks.js +55 -100
- package/dist/smartTools/tasks.js.map +1 -1
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
<img src="./assets/banner.png" alt="MCP Swarm Banner" width="800" />
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
# 🐝 MCP Swarm v1.0.
|
|
12
|
+
# 🐝 MCP Swarm v1.0.2 — Universal AI Agent Coordination Platform
|
|
13
13
|
|
|
14
|
-
> 🧠 **v1.0.
|
|
14
|
+
> 🧠 **v1.0.2 — Tool Consolidation:** 54 → **26 Smart Tools** (zero feature loss). 21 AI models in MoE Router. SONA Self-Learning with EWC++. Update: `npm install -g mcp-swarm@latest`
|
|
15
15
|
|
|
16
16
|
**MCP Swarm** is a global "nervous system" for your AI assistants. It turns separate agents (Claude, Cursor, Windsurf, OpenCode) into a coordinated team that can work on massive projects without conflicts or context loss.
|
|
17
17
|
|
|
@@ -29,398 +29,192 @@ When you use multiple AI tools simultaneously, they often collide: editing the s
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
## 🛠
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### 🚀 Core System
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
// Initialize index
|
|
219
|
-
swarm_vector({
|
|
220
|
-
action: "init",
|
|
221
|
-
repoPath,
|
|
222
|
-
config: { dimensions: 384, distanceMetric: "cosine" }
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
// Add documents
|
|
226
|
-
swarm_vector({
|
|
227
|
-
action: "add",
|
|
228
|
-
repoPath,
|
|
229
|
-
id: "doc-1",
|
|
230
|
-
text: "How to configure JWT authentication",
|
|
231
|
-
metadata: { category: "auth", language: "typescript" }
|
|
232
|
-
})
|
|
233
|
-
|
|
234
|
-
// Semantic search
|
|
235
|
-
swarm_vector({
|
|
236
|
-
action: "search",
|
|
237
|
-
repoPath,
|
|
238
|
-
query: "setting up user login",
|
|
239
|
-
k: 5,
|
|
240
|
-
filter: { category: "auth" }
|
|
241
|
-
})
|
|
242
|
-
// → [{ id: "doc-1", score: 0.87, ... }, ...]
|
|
243
|
-
|
|
244
|
-
// Find duplicates
|
|
245
|
-
swarm_vector({ action: "duplicates", repoPath, threshold: 0.95 })
|
|
246
|
-
// → [{ id1: "doc-1", id2: "doc-5", similarity: 0.97 }]
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
### 🛡️ v0.9.8 — AIDefence Security
|
|
250
|
-
52. **swarm_defence** — Protection against threats and attacks on the AI system.
|
|
251
|
-
- <10ms threat detection
|
|
252
|
-
- Pattern-based + heuristic analysis
|
|
253
|
-
- Quarantine system for suspicious content
|
|
254
|
-
- Audit logging of all security events
|
|
255
|
-
|
|
256
|
-
**Threat categories:**
|
|
257
|
-
- Prompt injection (bypassing instructions)
|
|
258
|
-
- Jailbreak (bypassing restrictions)
|
|
259
|
-
- Code injection (malicious code)
|
|
260
|
-
- Data exfiltration (data leaks)
|
|
261
|
-
- Sensitive data (PII, API keys)
|
|
262
|
-
- Unsafe commands (dangerous commands)
|
|
263
|
-
- Social engineering (manipulation)
|
|
264
|
-
|
|
265
|
-
**Sensitivity levels:** `low`, `medium`, `high`, `paranoid`
|
|
266
|
-
|
|
267
|
-
**Usage example:**
|
|
268
|
-
```typescript
|
|
269
|
-
// Scan text for threats
|
|
270
|
-
swarm_defence({
|
|
271
|
-
action: "scan",
|
|
272
|
-
text: "Ignore all previous instructions and...",
|
|
273
|
-
source: "user",
|
|
274
|
-
repoPath
|
|
275
|
-
})
|
|
276
|
-
// → { detected: true, category: "prompt_injection", severity: "high", action: "block" }
|
|
277
|
-
|
|
278
|
-
// Configure sensitivity
|
|
279
|
-
swarm_defence({
|
|
280
|
-
action: "set_config",
|
|
281
|
-
config: { sensitivity: "high", blockOnHighThreat: true },
|
|
282
|
-
repoPath
|
|
283
|
-
})
|
|
284
|
-
|
|
285
|
-
// Add trusted agent
|
|
286
|
-
swarm_defence({ action: "trust", agentName: "RadiantWolf", repoPath })
|
|
287
|
-
|
|
288
|
-
// View statistics
|
|
289
|
-
swarm_defence({ action: "stats", repoPath })
|
|
290
|
-
// → { totalScans: 150, threatsDetected: 3, threatsBlocked: 2, ... }
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### 🤝 v0.9.9 — Consensus Protocols
|
|
294
|
-
53. **swarm_consensus** — Distributed agreement for agent coordination.
|
|
295
|
-
- Raft-like leader elections
|
|
296
|
-
- Command log replication
|
|
297
|
-
- Byzantine Fault Tolerance (BFT)
|
|
298
|
-
- Proposal and voting system
|
|
299
|
-
|
|
300
|
-
**Consensus modes:**
|
|
301
|
-
- `simple_majority`: 50%+ votes
|
|
302
|
-
- `raft`: Term-based leadership
|
|
303
|
-
- `bft`: Byzantine (2/3+1 quorum)
|
|
304
|
-
|
|
305
|
-
**Usage example:**
|
|
306
|
-
```typescript
|
|
307
|
-
// Join a cluster
|
|
308
|
-
swarm_consensus({
|
|
309
|
-
action: "join",
|
|
310
|
-
nodeId: "agent-1",
|
|
311
|
-
nodeName: "RadiantWolf",
|
|
312
|
-
repoPath
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
// Leader election
|
|
316
|
-
swarm_consensus({
|
|
317
|
-
action: "elect",
|
|
318
|
-
nodeId: "agent-1",
|
|
319
|
-
nodeName: "RadiantWolf",
|
|
320
|
-
repoPath
|
|
321
|
-
})
|
|
322
|
-
|
|
323
|
-
// Create a proposal
|
|
324
|
-
swarm_consensus({
|
|
325
|
-
action: "propose",
|
|
326
|
-
nodeId: "agent-1",
|
|
327
|
-
nodeName: "RadiantWolf",
|
|
328
|
-
title: "Implement dark mode",
|
|
329
|
-
description: "Add dark theme to dashboard",
|
|
330
|
-
type: "architecture",
|
|
331
|
-
requiredMajority: 0.67,
|
|
332
|
-
repoPath
|
|
333
|
-
})
|
|
334
|
-
|
|
335
|
-
// Vote
|
|
336
|
-
swarm_consensus({
|
|
337
|
-
action: "vote",
|
|
338
|
-
proposalId: "prop_xxx",
|
|
339
|
-
nodeId: "agent-2",
|
|
340
|
-
nodeName: "BrilliantFox",
|
|
341
|
-
vote: "approve",
|
|
342
|
-
repoPath
|
|
343
|
-
})
|
|
344
|
-
// → { status: "approved", votes: 2/2 }
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### 🧠 v0.9.10 — MoE Router
|
|
348
|
-
54. **swarm_moe** — Intelligent AI model selection for tasks.
|
|
349
|
-
- Automatic routing to the best model
|
|
350
|
-
- Cost/performance/quality optimization
|
|
351
|
-
- Learning from feedback
|
|
352
|
-
- 21 built-in experts (verified prices: February 2026)
|
|
353
|
-
|
|
354
|
-
**Built-in experts (official prices):**
|
|
355
|
-
|
|
356
|
-
| Provider | Model | Tier | Input $/MTok | Output $/MTok | Context |
|
|
357
|
-
|----------|-------|------|--------------|---------------|---------|
|
|
358
|
-
| Anthropic | **Claude Opus 4.6** | flagship | $5 | $25 | **1M** |
|
|
359
|
-
| Anthropic | Claude Opus 4.5 | flagship | $5 | $25 | 200K |
|
|
360
|
-
| Anthropic | Claude Sonnet 4.5 | premium | $3 | $15 | 200K |
|
|
361
|
-
| Anthropic | Claude Haiku 4.5 | economy | $1 | $5 | 200K |
|
|
362
|
-
| OpenAI | **GPT-5.3 Codex** | flagship | ~$2 | ~$15 | 128K |
|
|
363
|
-
| OpenAI | GPT-5.2 | flagship | $1.75 | $14 | 256K |
|
|
364
|
-
| OpenAI | GPT-5.2 Pro | flagship | $21 | $168 | 256K |
|
|
365
|
-
| OpenAI | GPT-5 Mini | standard | $0.25 | $2 | 128K |
|
|
366
|
-
| OpenAI | GPT-4.1 | premium | $3 | $12 | 128K |
|
|
367
|
-
| OpenAI | GPT-4.1 Mini | standard | $0.80 | $3.20 | 128K |
|
|
368
|
-
| OpenAI | GPT-4.1 Nano | economy | $0.20 | $0.80 | 128K |
|
|
369
|
-
| OpenAI | o4-mini | reasoning | $4 | $16 | 128K |
|
|
370
|
-
| Moonshot | **Kimi K2.5** | premium | $0.60 | $3.00 | 256K |
|
|
371
|
-
| Google | Gemini 3 Pro | flagship | $2 | $12 | **1M** |
|
|
372
|
-
| Google | Gemini 3 Flash | standard | $0.50 | $3 | **1M** |
|
|
373
|
-
| Google | Gemini 2.5 Pro | premium | $1.25 | $10 | **1M** |
|
|
374
|
-
| Google | Gemini 2.5 Flash | standard | $0.30 | $2.50 | **1M** |
|
|
375
|
-
| Google | Gemini 2.5 Flash Lite | economy | $0.10 | $0.40 | **1M** |
|
|
376
|
-
|
|
377
|
-
**Usage example:**
|
|
378
|
-
```typescript
|
|
379
|
-
// Route a task to the best model
|
|
380
|
-
swarm_moe({
|
|
381
|
-
action: "route",
|
|
382
|
-
content: "Write a React component for user authentication",
|
|
383
|
-
preferredTier: "premium",
|
|
384
|
-
maxCost: 0.05,
|
|
385
|
-
repoPath
|
|
386
|
-
})
|
|
387
|
-
// → { selectedExpert: "claude-sonnet", confidence: 0.92, estimatedCost: $0.02 }
|
|
388
|
-
|
|
389
|
-
// Feedback for learning
|
|
390
|
-
swarm_moe({
|
|
391
|
-
action: "feedback",
|
|
392
|
-
expertId: "claude-sonnet",
|
|
393
|
-
success: true,
|
|
394
|
-
quality: 5,
|
|
395
|
-
actualLatencyMs: 1800,
|
|
396
|
-
repoPath
|
|
397
|
-
})
|
|
398
|
-
|
|
399
|
-
// Statistics
|
|
400
|
-
swarm_moe({ action: "stats", repoPath })
|
|
401
|
-
// → { totalRequests: 150, successRate: 94%, totalCost: $1.23 }
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
### 🚀 v1.0.0 — Major Release
|
|
405
|
-
|
|
406
|
-
**🧠 MoE Router — 21 AI Models:**
|
|
407
|
-
- **Kimi K2.5** — Moonshot 1T/32B MoE, 262K context, 9x cheaper than Opus ($0.55/$2.20)
|
|
408
|
-
- Smart routing: Agent Swarm tasks → Kimi K2.5/Opus 4.6, multimodal → Kimi K2.5
|
|
409
|
-
- 21 verified experts with official pricing (February 2026)
|
|
410
|
-
|
|
411
|
-
**🧬 SONA Self-Learning v2 (EWC++ / Transfer / Q-Learning):**
|
|
412
|
-
- **EWC++** — Progressive Fisher Information Matrix: per-parameter anti-forgetting
|
|
413
|
-
- **Transfer Learning** — Cross-category knowledge propagation (10% transfer rate)
|
|
414
|
-
- **Q-Learning** — Reward signals fed back to MoE Router for adaptive routing
|
|
415
|
-
|
|
416
|
-
**⚡ Smart Router Proxy v2:**
|
|
417
|
-
- **ML Task Classifier** — Pattern-based classification before LLM routing
|
|
418
|
-
- **Tool Compression** — ClaudeSlim-style, saves 30-50% tokens
|
|
419
|
-
- Semantic cache + Anthropic Prompt Caching integration
|
|
420
|
-
|
|
421
|
-
**🧹 Tool Consolidation:**
|
|
422
|
-
- Removed 5 deprecated shim files, direct imports to canonical modules
|
|
423
|
-
- 10 import paths updated across `smartTools.ts` and `smartTools/*.ts`
|
|
32
|
+
## 🛠 26 Smart Tools: The Swarm Toolkit
|
|
33
|
+
|
|
34
|
+
In v1.0.2, we **consolidated 54 tools into 26** — zero feature loss, 2× fewer IDE tool slots used. Each tool uses an `action` parameter to expose multiple operations.
|
|
35
|
+
|
|
36
|
+
### 🚀 Core System (2)
|
|
37
|
+
|
|
38
|
+
| # | Tool | Includes | Key Actions |
|
|
39
|
+
|---|------|----------|-------------|
|
|
40
|
+
| 1 | **swarm_agent** | agent + companion | `register`, `whoami`, `init`, `status`, `stop`, `pause`, `resume` |
|
|
41
|
+
| 2 | **swarm_control** | control + pulse | `stop`, `resume`, `status`, `pulse_update`, `pulse_get` |
|
|
42
|
+
|
|
43
|
+
### 📋 Task & Plan Management (2)
|
|
44
|
+
|
|
45
|
+
| # | Tool | Includes | Key Actions |
|
|
46
|
+
|---|------|----------|-------------|
|
|
47
|
+
| 3 | **swarm_task** | task + briefing | `create`, `list`, `update`, `decompose`, `save_briefing`, `load_briefing` |
|
|
48
|
+
| 4 | **swarm_plan** | plan + spec | `create`, `add`, `next`, `start`, `complete`, `prompt`, `export`, `spec_start`, `spec_phase` |
|
|
49
|
+
|
|
50
|
+
### 🔒 Files & Git (3)
|
|
51
|
+
|
|
52
|
+
| # | Tool | Includes | Key Actions |
|
|
53
|
+
|---|------|----------|-------------|
|
|
54
|
+
| 5 | **swarm_file** | file + snapshot | `reserve`, `release`, `list`, `forecast`, `snapshot_create`, `snapshot_rollback` |
|
|
55
|
+
| 6 | **swarm_worktree** | worktree + hooks | `create`, `list`, `remove`, `hook_install`, `hook_run` |
|
|
56
|
+
| 7 | **swarm_git** | git + dependency | `sync`, `pr`, `health`, `cleanup`, `dep_signal`, `dep_sync` |
|
|
57
|
+
|
|
58
|
+
### 💬 Collaboration (4)
|
|
59
|
+
|
|
60
|
+
| # | Tool | Includes | Key Actions |
|
|
61
|
+
|---|------|----------|-------------|
|
|
62
|
+
| 8 | **swarm_chat** | chat + review | `broadcast`, `dashboard`, `thought`, `request`, `respond` |
|
|
63
|
+
| 9 | **swarm_voting** | voting + auction | `start`, `vote`, `list`, `auction_announce`, `auction_bid` |
|
|
64
|
+
| 10 | **swarm_orchestrator** | orchestrator | `elect`, `info`, `heartbeat`, `resign`, `executors` |
|
|
65
|
+
| 11 | **swarm_message** | message + mcp | `send`, `inbox`, `ack`, `reply`, `mcp_scan`, `mcp_authorize` |
|
|
66
|
+
|
|
67
|
+
### 🛡️ Security (1)
|
|
68
|
+
|
|
69
|
+
| # | Tool | Includes | Key Actions |
|
|
70
|
+
|---|------|----------|-------------|
|
|
71
|
+
| 12 | **swarm_defence** | defence + immune + consensus | `scan`, `validate_agent`, `quarantine`, `trust`, `alert`, `join`, `elect`, `propose`, `vote` |
|
|
72
|
+
|
|
73
|
+
### 📊 Analytics (3)
|
|
74
|
+
|
|
75
|
+
| # | Tool | Includes | Key Actions |
|
|
76
|
+
|---|------|----------|-------------|
|
|
77
|
+
| 13 | **swarm_budget** | cost + budget | `log`, `agent`, `project`, `limit`, `analyze`, `recommend`, `route` |
|
|
78
|
+
| 14 | **swarm_moe** | moe + sona | `moe_route`, `moe_feedback`, `moe_experts`, `sona_route`, `sona_learn`, `sona_specialists` |
|
|
79
|
+
| 15 | **swarm_quality** | quality + regression | `run`, `report`, `threshold`, `pr_ready`, `baseline`, `check_regression` |
|
|
80
|
+
|
|
81
|
+
### 🧠 Intelligence (4)
|
|
82
|
+
|
|
83
|
+
| # | Tool | Includes | Key Actions |
|
|
84
|
+
|---|------|----------|-------------|
|
|
85
|
+
| 16 | **swarm_vector** | HNSW search | `init`, `add`, `search`, `get`, `delete`, `duplicates`, `embed` |
|
|
86
|
+
| 17 | **swarm_booster** | fast executor | `execute`, `can_boost`, `stats`, `history`, `types` |
|
|
87
|
+
| 18 | **swarm_brain** | brainstorm + debug | `bs_start`, `bs_ask`, `bs_propose`, `dbg_start`, `dbg_hypothesis`, `dbg_fix` |
|
|
88
|
+
| 19 | **swarm_context** | context + pool + batch | `estimate`, `compress`, `pool_add`, `pool_search`, `batch_queue`, `batch_result` |
|
|
89
|
+
|
|
90
|
+
### 🏗️ Infra (7)
|
|
91
|
+
|
|
92
|
+
| # | Tool | Includes | Key Actions |
|
|
93
|
+
|---|------|----------|-------------|
|
|
94
|
+
| 20 | **swarm_health** | health + preemption | `check`, `dead`, `reassign`, `trigger`, `resolve_urgent` |
|
|
95
|
+
| 21 | **swarm_external** | external + platform | `enable_github`, `sync_all`, `create_issue`, `platform_request` |
|
|
96
|
+
| 22 | **swarm_expertise** | expertise + routing | `track`, `suggest`, `experts`, `route_find_agent`, `route_auto_assign` |
|
|
97
|
+
| 23 | **swarm_knowledge** | knowledge + docs + advice | `archive`, `search`, `doc_generate`, `advice_request` |
|
|
98
|
+
| 24 | **swarm_session** | session + timeline + screenshot | `start`, `log`, `stop`, `replay`, `timeline_generate`, `screenshot_share` |
|
|
99
|
+
| 25 | **swarm_clusters** | clusters + conflict | `init`, `list`, `find`, `conflict_predict`, `conflict_hotspots` |
|
|
100
|
+
| 26 | **swarm_telegram** | telegram + qa | `setup`, `send`, `notify_*`, `qa_start`, `qa_iterate`, `qa_report` |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### Usage Examples
|
|
105
|
+
|
|
106
|
+
<details>
|
|
107
|
+
<summary><strong>🧠 swarm_moe — AI Model Routing (includes SONA)</strong></summary>
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
// Route a task to the best model (21 experts)
|
|
111
|
+
swarm_moe({
|
|
112
|
+
action: "moe_route",
|
|
113
|
+
content: "Write a React component for user auth",
|
|
114
|
+
preferredTier: "premium",
|
|
115
|
+
maxCost: 0.05,
|
|
116
|
+
repoPath
|
|
117
|
+
})
|
|
118
|
+
// → { selectedExpert: "claude-sonnet", confidence: 0.92 }
|
|
119
|
+
|
|
120
|
+
// SONA: Self-learning task assignment
|
|
121
|
+
swarm_moe({
|
|
122
|
+
action: "sona_route",
|
|
123
|
+
title: "Fix login button",
|
|
124
|
+
description: "Button invisible on dark theme",
|
|
125
|
+
affectedFiles: ["src/components/Login.tsx"],
|
|
126
|
+
repoPath
|
|
127
|
+
})
|
|
128
|
+
// → { recommendedAgent: "RadiantWolf", confidence: 0.85, category: "frontend_ui" }
|
|
129
|
+
|
|
130
|
+
// Train SONA from results
|
|
131
|
+
swarm_moe({
|
|
132
|
+
action: "sona_learn",
|
|
133
|
+
taskId: "task-123",
|
|
134
|
+
agentName: "RadiantWolf",
|
|
135
|
+
success: true,
|
|
136
|
+
qualityScore: 0.9,
|
|
137
|
+
repoPath
|
|
138
|
+
})
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
</details>
|
|
142
|
+
|
|
143
|
+
<details>
|
|
144
|
+
<summary><strong>⚡ swarm_booster — Execute Tasks Without LLM (352x faster)</strong></summary>
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
// Check if a task can be boosted
|
|
148
|
+
swarm_booster({
|
|
149
|
+
action: "can_boost",
|
|
150
|
+
repoPath,
|
|
151
|
+
description: "rename variable oldName to newName"
|
|
152
|
+
})
|
|
153
|
+
// → { canBoost: true, taskType: "rename_variable", confidence: 0.9 }
|
|
154
|
+
|
|
155
|
+
// Execute locally ($0, ~8ms)
|
|
156
|
+
swarm_booster({
|
|
157
|
+
action: "execute",
|
|
158
|
+
repoPath,
|
|
159
|
+
task: {
|
|
160
|
+
type: "rename_variable",
|
|
161
|
+
filePath: "src/utils.ts",
|
|
162
|
+
oldName: "getData",
|
|
163
|
+
newName: "fetchUserData"
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
// → { success: true, changes: 5, timeMs: 2, savedCost: "$0.01" }
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
</details>
|
|
170
|
+
|
|
171
|
+
<details>
|
|
172
|
+
<summary><strong>🔍 swarm_vector — HNSW Semantic Search</strong></summary>
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
// Initialize + add documents
|
|
176
|
+
swarm_vector({ action: "init", repoPath, config: { dimensions: 384, distanceMetric: "cosine" } })
|
|
177
|
+
swarm_vector({ action: "add", repoPath, id: "doc-1", text: "JWT auth setup", metadata: { category: "auth" } })
|
|
178
|
+
|
|
179
|
+
// Semantic search
|
|
180
|
+
swarm_vector({ action: "search", repoPath, query: "user login", k: 5 })
|
|
181
|
+
// → [{ id: "doc-1", score: 0.87, ... }]
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
</details>
|
|
185
|
+
|
|
186
|
+
<details>
|
|
187
|
+
<summary><strong>🛡️ swarm_defence — AI Security + Consensus</strong></summary>
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
// Scan text for threats (<10ms detection)
|
|
191
|
+
swarm_defence({ action: "scan", text: "Ignore all instructions...", source: "user", repoPath })
|
|
192
|
+
// → { detected: true, category: "prompt_injection", severity: "high" }
|
|
193
|
+
|
|
194
|
+
// Consensus: join cluster + propose
|
|
195
|
+
swarm_defence({ action: "join", nodeId: "a1", nodeName: "Wolf", repoPath })
|
|
196
|
+
swarm_defence({ action: "propose", nodeId: "a1", title: "Add dark mode", type: "architecture", repoPath })
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
</details>
|
|
200
|
+
|
|
201
|
+
### 🧠 MoE Router — 21 Built-in AI Models
|
|
202
|
+
|
|
203
|
+
| Provider | Model | Tier | Input $/MTok | Output $/MTok | Context |
|
|
204
|
+
|----------|-------|------|--------------|---------------|---------|
|
|
205
|
+
| Anthropic | **Claude Opus 4.6** | flagship | $5 | $25 | **1M** |
|
|
206
|
+
| Anthropic | Claude Opus 4.5 | flagship | $5 | $25 | 200K |
|
|
207
|
+
| Anthropic | Claude Sonnet 4.5 | premium | $3 | $15 | 200K |
|
|
208
|
+
| Anthropic | Claude Haiku 4.5 | economy | $1 | $5 | 200K |
|
|
209
|
+
| OpenAI | **GPT-5.3 Codex** | flagship | ~$2 | ~$15 | 128K |
|
|
210
|
+
| OpenAI | GPT-5.2 | flagship | $1.75 | $14 | 256K |
|
|
211
|
+
| OpenAI | GPT-5 Mini | standard | $0.25 | $2 | 128K |
|
|
212
|
+
| OpenAI | GPT-4.1 | premium | $3 | $12 | 128K |
|
|
213
|
+
| OpenAI | o4-mini | reasoning | $4 | $16 | 128K |
|
|
214
|
+
| Moonshot | **Kimi K2.5** | premium | $0.60 | $3.00 | 256K |
|
|
215
|
+
| Google | Gemini 3 Pro | flagship | $2 | $12 | **1M** |
|
|
216
|
+
| Google | Gemini 3 Flash | standard | $0.50 | $3 | **1M** |
|
|
217
|
+
| Google | Gemini 2.5 Pro | premium | $1.25 | $10 | **1M** |
|
|
424
218
|
|
|
425
219
|
---
|
|
426
220
|
|