agi-farm 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 CHANGED
@@ -6,10 +6,10 @@
6
6
 
7
7
  **Build production-ready AI teams with a single command**
8
8
 
9
+ [![npm version](https://img.shields.io/npm/v/agi-farm.svg)](https://www.npmjs.com/package/agi-farm)
9
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
11
  [![OpenClaw](https://img.shields.io/badge/OpenClaw-Plugin-blue.svg)](https://docs.openclaw.ai)
11
12
  [![Node.js](https://img.shields.io/badge/Node.js-20%2B-green.svg)](https://nodejs.org/)
12
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://www.typescriptlang.org/)
13
13
 
14
14
  [Quick Start](#-quick-start) • [Features](#-what-it-does) • [Documentation](#-commands) • [Architecture](#-architecture)
15
15
 
@@ -29,8 +29,21 @@
29
29
  | 🔄 **Auto-Dispatcher** | Smart task delegation with HITL, backoff & dependencies |
30
30
  | 📦 **Portable Bundle** | Export your entire team to GitHub with one command |
31
31
  | 🏗️ **ESM Native** | Built for Node 20+ with full ES Module support |
32
- | 🛡️ **Production Hardened** | Audited for security, memory leaks, and CLI timeouts |
33
- | 🧪 **Unit Tested** | Core parsing and logic verified with a Jest/ESM test suite |
32
+ | 🛡️ **Production Hardened** | Security-audited with CSRF, Origin validation, and timing-safe auth |
33
+ | 🧪 **28 Unit Tests** | Extension lifecycle, security, parsing, and CLI utilities verified with Jest/ESM |
34
+
35
+ ---
36
+
37
+ ## 🆕 Recent Updates
38
+
39
+ - 🔐 **Origin validation**: mutation endpoints now validate `Origin` header — only localhost origins accepted.
40
+ - 🔒 **Timing-safe auth hardened**: CSRF token comparison no longer leaks token length via timing.
41
+ - 🧪 **28 unit tests**: added extension lifecycle, security, and shared utility test suites (was 6).
42
+ - 📦 **Removed unused `sse.js`**: dependency cleaned from `package.json`.
43
+ - 🔄 **Dynamic versioning**: extension reads version from `package.json` instead of hardcoding.
44
+ - 🛠️ **ESM `__dirname` fix**: `src/index.ts` now uses `import.meta.dirname` with proper fallback.
45
+ - 🧰 **Shared utilities**: extracted `runCommand` to `scripts/lib/run-command.js` — eliminates duplication.
46
+ - ✅ **Env var consistency**: `export.js` and `status.js` now respect `AGI_FARM_WORKSPACE` like all other scripts.
34
47
 
35
48
  ---
36
49
 
@@ -88,37 +101,35 @@
88
101
  ### Install
89
102
 
90
103
  ```bash
91
- # Install from npm (when published)
92
- openclaw plugins install agi-farm
104
+ # Install officially from npm
105
+ npm install -g agi-farm
93
106
 
94
- # Or install from GitHub
95
- openclaw plugins install https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN.git
107
+ # Or via OpenClaw plugin manager
108
+ openclaw plugins install agi-farm
96
109
  ```
97
110
 
98
111
  ### Run Setup Wizard
99
112
 
100
113
  ```bash
101
114
  # Start the interactive wizard
102
- /agi-farm setup
115
+ agi-farm setup
103
116
  ```
104
117
 
105
- Answer 6 questions and your team will be live in ~2 minutes:
118
+ Answer the setup prompts and your team will be live in ~2 minutes:
106
119
 
107
120
  ```
108
121
  🧙 AGI Farm Setup Wizard
109
122
 
110
123
  ? Team name (e.g., "CooperCorp"): MyTeam
124
+ ? Orchestrator name: Cooper
111
125
  ? Team size: 11 agents (Full Stack)
112
- ? Domain: Software Development
113
- ? Primary framework: langgraph
114
- ? GitHub repo: myteam/ai-agents
126
+ ? Domain: general
127
+ ? Collaboration frameworks: langgraph
115
128
  ? Confirm setup? Yes
116
129
 
117
130
  ✅ Creating 11 agents...
118
131
  ✅ Setting up workspace...
119
- Registering cron jobs...
120
- ✅ Creating GitHub bundle...
121
- ✅ Launching dashboard...
132
+ Initializing AGI Farm registries...
122
133
 
123
134
  🎉 Your AI team is ready!
124
135
  ```
@@ -129,13 +140,13 @@ Answer 6 questions and your team will be live in ~2 minutes:
129
140
 
130
141
  | Command | Description | Example |
131
142
  |---------|-------------|---------|
132
- | 🎯 `/agi-farm setup` | Full wizard — agents, workspace, crons | Sets up complete team |
133
- | 🗑️ `/agi-farm teardown` | Full uninstall — removes agents & workspace | Reverts system to clean state |
134
- | 📊 `/agi-farm status` | Team health: agents, tasks, cron status | Shows real-time metrics |
135
- | 🔧 `/agi-farm rebuild` | Regenerate workspace from bundle | After git pull |
136
- | 📤 `/agi-farm export` | Push bundle to GitHub | Creates new release |
137
- | 🖥️ `/agi-farm dashboard` | Launch live ops room (SSE, :8080) | Opens in browser |
138
- | ⚡ `/agi-farm dispatch` | Run auto-dispatcher manually | Test task routing |
143
+ | 🎯 `agi-farm setup` | Full wizard — agents, workspace, crons | Sets up complete team |
144
+ | 🗑️ `agi-farm teardown` | Full uninstall — removes agents, bundle, and AGI Farm-owned registries (`TASKS.json`, `AGENT_STATUS.json`) | Reverts system to clean state |
145
+ | 📊 `agi-farm status` | Team health: agents, tasks, cron status | Shows real-time metrics |
146
+ | 🔧 `agi-farm rebuild` | Regenerate workspace from bundle | After git pull |
147
+ | 📤 `agi-farm export` | Push bundle to GitHub | Creates new release |
148
+ | 🖥️ `agi-farm dashboard` | Launch live ops room (SSE, :8080) | Opens in browser |
149
+ | ⚡ `agi-farm dispatch` | Run auto-dispatcher manually | Test task routing |
139
150
 
140
151
  ---
141
152
 
@@ -144,11 +155,11 @@ Answer 6 questions and your team will be live in ~2 minutes:
144
155
  ### Plugin Structure
145
156
 
146
157
  ```
147
- .openclaw/extensions/agi-farm/
158
+ .openclaw/extensions/agi-farm/ (or global node_modules/agi-farm/)
148
159
  ├── 📦 package.json Plugin manifest (ESM)
149
160
  ├── ⚙️ openclaw.plugin.json Config schema & commands
150
- ├── 📂 src/
151
- │ └── 💻 index.ts Main plugin entry (TypeScript)
161
+ ├── 📂 dist/ Compiled TypeScript (backend)
162
+ ├── 📂 dashboard-dist/ Built React frontend (production)
152
163
  ├── 🌐 server/
153
164
  │ ├── 🖥️ dashboard.js SSE server (Node.js)
154
165
  │ └── 🛠️ utils.js Core parsing & logic (Unit Tested)
@@ -159,9 +170,11 @@ Answer 6 questions and your team will be live in ~2 minutes:
159
170
  │ ├── 🔧 rebuild.js Rebuilder
160
171
  │ ├── 📤 export.js GitHub exporter
161
172
  │ ├── 🖥️ dashboard.js Dashboard launcher
162
- └── ⚡ dispatch.js Auto-dispatcher
173
+ ├── ⚡ dispatch.js Auto-dispatcher
174
+ │ └── 📂 lib/
175
+ │ └── 🛠️ run-command.js Shared CLI utility
163
176
  ├── 📋 templates/ Agent & workspace templates
164
- ├── ⚛️ dashboard-react/ Vite + React 18 frontend
177
+ ├── ⚛️ dashboard-react/ Vite + React 18 source (Dev)
165
178
  └── 📚 skills/
166
179
  └── 📖 SKILL.md Embedded documentation
167
180
  ```
@@ -284,16 +297,16 @@ Complete team for complex systems - **RECOMMENDED**
284
297
 
285
298
  Choose the right model for each role to optimize cost and quality:
286
299
 
287
- | Role | Model Tier | Why | Cost/Quality |
300
+ | Role | Recommended Model | Why | Cost/Quality |
288
301
  |------|-----------|-----|--------------|
289
- | 🦅 Orchestrator | **High** (`sonnet`, `opus`) | Delegation judgment, broad reasoning | 💰💰💰 / ⭐⭐⭐ |
290
- | 🔮 Architect | **High** | Deep analysis, design decisions | 💰💰💰 / ⭐⭐⭐ |
291
- | ⚒️ Engineer | **Mid** (`glm-5`, `sonnet`) | Fast code gen, cost-efficiency | 💰💰 / ⭐⭐ |
292
- | 🐛 Debugger | **High** (`opus`) | Root-cause analysis, precision | 💰💰💰 / ⭐⭐⭐ |
293
- | 🔭 Analyst | **Mid-High** (`gemini-2.0-pro-exp`) | Long-context research | 💰💰 / ⭐⭐⭐ |
294
- | 🛡️ QA | **Fast** (`glm-4.7-flash`) | High-volume pattern checks | 💰 / ⭐⭐ |
295
- | ⚓ Content | **Multimodal** (`gemini-2.0-pro-exp`) | Vision + rich generation | 💰💰 / ⭐⭐⭐ |
296
- | 🧪 R&D | **High** | Creative + structured experiments | 💰💰💰 / ⭐⭐⭐ |
302
+ | 🦅 Orchestrator | `anthropic/claude-3-5-sonnet` | High-level planning & delegation | 💰💰💰 / ⭐⭐⭐ |
303
+ | 🔮 Architect | `anthropic/claude-3-opus` | Deep reasoning & system design | 💰💰💰 / ⭐⭐⭐ |
304
+ | ⚒️ Engineer | `google/gemini-1.5-pro` | Reliable code gen & large context | 💰💰 / ⭐⭐ |
305
+ | 🐛 Debugger | `anthropic/claude-3-5-sonnet` | Precision logic & error analysis | 💰💰 / ⭐⭐⭐ |
306
+ | 🔭 Analyst | `google/gemini-2.0-flash` | Ultra-fast data synthesis | 💰 / ⭐⭐ |
307
+ | 🛡️ QA | `anthropic/claude-3-haiku` | Rapid pattern validation | 💰 / |
308
+ | ⚓ Content | `google/gemini-1.5-pro` | Rich multimodal generation | 💰💰 / ⭐⭐⭐ |
309
+ | 🧪 R&D | `deepseek/deepseek-reasoner` | Structured creative experimentation | 💰 / ⭐⭐⭐ |
297
310
 
298
311
  ---
299
312
 
@@ -408,7 +421,7 @@ The auto-dispatcher intelligently routes tasks to agents:
408
421
 
409
422
  ```bash
410
423
  # Manual dry-run
411
- /agi-farm dispatch
424
+ agi-farm dispatch
412
425
 
413
426
  # Check logs
414
427
  tail -f ~/.openclaw/workspace/logs/auto-dispatch.log
@@ -426,8 +439,8 @@ cd AGI-FARM-PLUGIN
426
439
  # Install dependencies
427
440
  npm install
428
441
 
429
- # Build TypeScript
430
- npm run build
442
+ # Build backend and dashboard
443
+ npm run build:all
431
444
 
432
445
  # Link to OpenClaw extensions
433
446
  ln -s $(pwd) ~/.openclaw/extensions/agi-farm
@@ -438,7 +451,10 @@ ln -s $(pwd) ~/.openclaw/extensions/agi-farm
438
451
  ## 💻 Development
439
452
 
440
453
  ```bash
441
- # Build TypeScript
454
+ # Build everything (TS + Dashboard)
455
+ npm run build:all
456
+
457
+ # Build backend only
442
458
  npm run build
443
459
 
444
460
  # Watch mode for development
@@ -463,14 +479,13 @@ npm run start-dashboard
463
479
 
464
480
  | Symptom | Fix | Command |
465
481
  |---------|-----|---------|
466
- | ❌ Plugin fails to load | Install dependencies | `npm install` |
467
- | 📊 Dashboard shows stale data | Restart dashboard | `/agi-farm dashboard` |
468
- | 🤖 Agent stuck >30 min | Check broadcast | `cat comms/broadcast.md` |
469
- | ⚠️ `openclaw` not found | Add to PATH | `export PATH=$PATH:/path/to/openclaw` |
470
- | 🔐 `gh repo create` fails | Login to GitHub | `gh auth login` |
471
- | ⏰ Cron shows 0 crons | Check duplicates | `openclaw cron list` |
472
- | 📄 TASKS.json parse error | Validate JSON | `python3 -m json.tool TASKS.json` |
473
- | 🐌 Rate-limit too aggressive | Adjust backoff | Edit dispatch script |
482
+ | ❌ Plugin fails to load | Check global install | `npm list -g agi-farm` |
483
+ | 📊 Dashboard shows stale data | Sync with workspace | `agi-farm status` |
484
+ | 🤖 Agent stuck >30 min | Verify heartbeats | `cat ~/.openclaw/workspace/HEARTBEAT.md` |
485
+ | ⚠️ `openclaw` not found | Add to PATH | `export PATH=$PATH:$(npm bin -g)` |
486
+ | 🔐 Access Denied | Check npm login | `npm whoami` |
487
+ | ⏰ Cron registration error | Clean crontab | `openclaw cron list --fix` |
488
+ | 📄 JSON Parse Error | Re-run setup | `agi-farm setup --force` |
474
489
 
475
490
  ---
476
491
 
@@ -480,10 +495,11 @@ This plugin is designed with security in mind:
480
495
 
481
496
  | ✅ What It Does | ❌ What It Doesn't Do |
482
497
  |----------------|----------------------|
498
+ | Binds dashboard to `127.0.0.1` only | Expose data to the network |
499
+ | Validates `Origin` header on all mutations | Accept cross-origin requests |
500
+ | Uses CSRF tokens with timing-safe comparison | Leak token length via timing |
483
501
  | Uses OpenClaw CLI (inherits credentials) | Store API keys or tokens |
484
502
  | Reads/writes local workspace files | Send data to external servers |
485
- | Runs local HTTP server (127.0.0.1) | Expose data to network |
486
- | Uses your configured LLM providers | Add additional authentication |
487
503
 
488
504
  **Your credentials stay in OpenClaw's configuration.**
489
505
 
@@ -522,6 +538,16 @@ MIT License — built for [OpenClaw](https://docs.openclaw.ai)
522
538
 
523
539
  Copyright (c) 2025 oabdelmaksoud
524
540
 
541
+ ## 📈 Star History
542
+
543
+ <a href="https://www.star-history.com/?repos=oabdelmaksoud%2FAGI-FARM-PLUGIN&type=date&legend=top-left">
544
+ <picture>
545
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=oabdelmaksoud/AGI-FARM-PLUGIN&type=date&theme=dark&legend=bottom-right" />
546
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=oabdelmaksoud/AGI-FARM-PLUGIN&type=date&legend=bottom-right" />
547
+ <img alt="Star History Chart" src="https://api.star-history.com/image?repos=oabdelmaksoud/AGI-FARM-PLUGIN&type=date&legend=bottom-right" />
548
+ </picture>
549
+ </a>
550
+
525
551
  ---
526
552
 
527
553
  ## 🔗 Links
@@ -529,7 +555,7 @@ Copyright (c) 2025 oabdelmaksoud
529
555
  - **GitHub**: https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN
530
556
  - **Issues**: https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN/issues
531
557
  - **OpenClaw Docs**: https://docs.openclaw.ai
532
- - **NPM Package**: (coming soon)
558
+ - **NPM Package**: https://www.npmjs.com/package/agi-farm
533
559
 
534
560
  ---
535
561