agi-farm 1.0.0
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/LICENSE.md +21 -0
- package/README.md +542 -0
- package/dashboard-dist/assets/index-BkPgvUOQ.js +50 -0
- package/dashboard-dist/assets/index-CAS2IEKB.css +1 -0
- package/dashboard-dist/index.html +14 -0
- package/dashboard-dist/vite.svg +1 -0
- package/openclaw.plugin.json +103 -0
- package/package.json +94 -0
- package/scripts/dashboard.js +46 -0
- package/scripts/dispatch.js +48 -0
- package/scripts/export.js +81 -0
- package/scripts/rebuild.js +65 -0
- package/scripts/setup.js +361 -0
- package/scripts/status.js +82 -0
- package/scripts/teardown.js +109 -0
- package/server/dashboard.js +459 -0
- package/server/utils.js +83 -0
- package/skills/agi-farm/SKILL.md +439 -0
- package/templates/AGENTS.md.template +37 -0
- package/templates/BOOTSTRAP.md.template +39 -0
- package/templates/CLAUDE.md.template +119 -0
- package/templates/DASHBOARD.md.template +31 -0
- package/templates/DECISIONS.md.template +16 -0
- package/templates/EXPERIMENTS.json.template +10 -0
- package/templates/FAILURES.md.template +13 -0
- package/templates/HEARTBEAT.md.template +24 -0
- package/templates/IDENTITY.md.template +34 -0
- package/templates/IMPROVEMENT_BACKLOG.json.template +29 -0
- package/templates/MEMORY.md.template +39 -0
- package/templates/PROCESSES.json.template +61 -0
- package/templates/README.md.bundle.template +78 -0
- package/templates/SHARED_KNOWLEDGE.json.template +10 -0
- package/templates/SOUL.md.anchor +61 -0
- package/templates/SOUL.md.cipher +69 -0
- package/templates/SOUL.md.evolve +58 -0
- package/templates/SOUL.md.forge +55 -0
- package/templates/SOUL.md.generic +65 -0
- package/templates/SOUL.md.lens +62 -0
- package/templates/SOUL.md.main +96 -0
- package/templates/SOUL.md.nova +75 -0
- package/templates/SOUL.md.pixel +58 -0
- package/templates/SOUL.md.sage +67 -0
- package/templates/SOUL.md.vigil +71 -0
- package/templates/SOUL.md.vista +64 -0
- package/templates/TASKS.json.template +34 -0
- package/templates/TOOLS.md.template +26 -0
- package/templates/USER.md.template +18 -0
- package/templates/install.sh.template +79 -0
- package/templates/standards/coding.md.template +27 -0
- package/templates/standards/documentation.md.template +26 -0
- package/templates/standards/quality.md.template +37 -0
- package/templates/standards/research.md.template +23 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Rajdhani:wght@400;500;600;700&display=swap";*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}:root{--bg: #080810;--bg2: #0d0d1a;--bg3: #111122;--cyan: #00e5ff;--amber: #ffd600;--green: #00e676;--red: #ff1744;--purple: #e040fb;--text: #e0e0e0;--muted: #546e7a;--surface: rgba(255,255,255,.03);--border: rgba(0,229,255,.1);--border-h: rgba(0,229,255,.4);--shadow: 0 0 20px rgba(0,229,255,.08)}html,body{height:100%;background:var(--bg);color:var(--text);font-family:JetBrains Mono,monospace;font-size:13px;line-height:1.5}body:after{content:"";position:fixed;inset:0;pointer-events:none;z-index:9999;background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,.03) 2px,rgba(0,0,0,.03) 4px)}#root{min-height:100vh}@keyframes pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.4;transform:scale(.75)}}@keyframes glow-pulse{0%,to{box-shadow:0 0 6px #00e5ff66}50%{box-shadow:0 0 16px #00e5ffe6}}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.fade-in{animation:fadeIn .3s ease}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}.dot-active{background:var(--green);animation:pulse 2s infinite}.dot-available{background:var(--cyan)}.dot-busy{background:var(--amber);animation:pulse 1.5s infinite}.dot-error{background:var(--red);animation:pulse 1s infinite}.dot-offline{background:var(--muted)}.badge{padding:2px 7px;border-radius:3px;font-size:10px;font-weight:600;text-transform:uppercase}.badge-active{background:#00e67626;color:var(--green);border:1px solid rgba(0,230,118,.3)}.badge-available{background:#00e5ff1a;color:var(--cyan);border:1px solid rgba(0,229,255,.3)}.badge-busy{background:#ffd6001f;color:var(--amber);border:1px solid rgba(255,214,0,.3)}.badge-error{background:#ff17441f;color:var(--red);border:1px solid rgba(255,23,68,.3)}.badge-offline{background:#546e7a1f;color:var(--muted);border:1px solid rgba(84,110,122,.3)}.badge-complete{background:#00e6761a;color:var(--green);border:1px solid rgba(0,230,118,.25)}.badge-pending{background:#00e5ff14;color:var(--cyan);border:1px solid rgba(0,229,255,.2)}.badge-in-progress{background:#ffd6001a;color:var(--amber);border:1px solid rgba(255,214,0,.25)}.badge-failed{background:#ff17441a;color:var(--red);border:1px solid rgba(255,23,68,.25)}.badge-hitl{background:#e040fb1f;color:var(--purple);border:1px solid rgba(224,64,251,.3)}.badge-blocked{background:#ff17441f;color:var(--red);border:1px solid rgba(255,23,68,.3)}.p1{background:#ff174426;color:var(--red);border:1px solid rgba(255,23,68,.4);padding:1px 5px;border-radius:2px;font-size:9px;font-weight:700}.p2{background:#ffd6001f;color:var(--amber);border:1px solid rgba(255,214,0,.4);padding:1px 5px;border-radius:2px;font-size:9px;font-weight:700}.p3{background:#00e5ff14;color:var(--cyan);border:1px solid rgba(0,229,255,.3);padding:1px 5px;border-radius:2px;font-size:9px;font-weight:700}.card{background:var(--bg2);border:1px solid var(--border);border-radius:8px;padding:14px}.card:hover{border-color:var(--border-h);box-shadow:var(--shadow)}.progress-track{height:6px;background:#ffffff0f;border-radius:3px;overflow:hidden}.progress-fill{height:100%;border-radius:3px;transition:width .4s ease}.section-title{font-size:10px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}::-webkit-scrollbar{width:4px;height:4px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#00e5ff33;border-radius:2px}button:focus-visible,input:focus-visible{outline:2px solid var(--cyan);outline-offset:2px}.card:focus-within{border-color:var(--border-h);box-shadow:var(--shadow)}input::placeholder{color:var(--muted);opacity:.6}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>š¦
</text></svg>" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>CooperCorp AGI ā Ops Room</title>
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BkPgvUOQ.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CAS2IEKB.css">
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<div id="root"></div>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "agi-farm",
|
|
3
|
+
"kind": "team-orchestration",
|
|
4
|
+
"name": "AGI Farm ā Multi-Agent Team Builder",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Bootstrap complete multi-agent AI teams with auto-dispatcher, live dashboard, and infrastructure. Includes interactive wizard, SOUL.md generation, comms setup, cron registration, and React + SSE ops room.",
|
|
7
|
+
"author": "oabdelmaksoud",
|
|
8
|
+
"homepage": "https://github.com/oabdelmaksoud/openclaw-skills/tree/main/agi-farm",
|
|
9
|
+
"configSchema": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"properties": {
|
|
13
|
+
"dashboardPort": {
|
|
14
|
+
"type": "number",
|
|
15
|
+
"default": 8080,
|
|
16
|
+
"minimum": 1024,
|
|
17
|
+
"maximum": 65535,
|
|
18
|
+
"description": "Port for the live ops dashboard (SSE + React)"
|
|
19
|
+
},
|
|
20
|
+
"dashboardHost": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"default": "127.0.0.1",
|
|
23
|
+
"description": "Bind address for the dashboard server"
|
|
24
|
+
},
|
|
25
|
+
"autoStartDashboard": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": true,
|
|
28
|
+
"description": "Automatically start the dashboard when plugin loads"
|
|
29
|
+
},
|
|
30
|
+
"workspacePath": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Path to OpenClaw workspace (defaults to ~/.openclaw/workspace)"
|
|
33
|
+
},
|
|
34
|
+
"bundlePath": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Path to AGI Farm bundle (defaults to <workspace>/agi-farm-bundle)"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": []
|
|
40
|
+
},
|
|
41
|
+
"uiHints": {
|
|
42
|
+
"dashboardPort": {
|
|
43
|
+
"label": "Dashboard Port",
|
|
44
|
+
"description": "Port for the live ops dashboard (SSE + React)"
|
|
45
|
+
},
|
|
46
|
+
"dashboardHost": {
|
|
47
|
+
"label": "Dashboard Host",
|
|
48
|
+
"description": "Bind address for the dashboard server"
|
|
49
|
+
},
|
|
50
|
+
"autoStartDashboard": {
|
|
51
|
+
"label": "Auto-Start Dashboard",
|
|
52
|
+
"description": "Automatically start the dashboard when OpenClaw loads"
|
|
53
|
+
},
|
|
54
|
+
"workspacePath": {
|
|
55
|
+
"label": "Workspace Path",
|
|
56
|
+
"description": "Path to OpenClaw workspace directory"
|
|
57
|
+
},
|
|
58
|
+
"bundlePath": {
|
|
59
|
+
"label": "Bundle Path",
|
|
60
|
+
"description": "Path to AGI Farm team bundle directory"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"skills": [
|
|
64
|
+
"skills/agi-farm"
|
|
65
|
+
],
|
|
66
|
+
"commands": [
|
|
67
|
+
{
|
|
68
|
+
"name": "agi-farm setup",
|
|
69
|
+
"description": "Interactive wizard to create a new multi-agent AI team",
|
|
70
|
+
"handler": "./scripts/setup.js"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "agi-farm status",
|
|
74
|
+
"description": "Show team health: agents, tasks, cron status",
|
|
75
|
+
"handler": "./scripts/status.js"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "agi-farm rebuild",
|
|
79
|
+
"description": "Regenerate workspace from existing bundle (preserves edits)",
|
|
80
|
+
"handler": "./scripts/rebuild.js"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "agi-farm export",
|
|
84
|
+
"description": "Push team bundle to GitHub repository",
|
|
85
|
+
"handler": "./scripts/export.js"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "agi-farm dashboard",
|
|
89
|
+
"description": "Launch live ops room dashboard (React + SSE)",
|
|
90
|
+
"handler": "./scripts/dashboard.js"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"name": "agi-farm dispatch",
|
|
94
|
+
"description": "Run auto-dispatcher ā fires agent sessions for pending tasks",
|
|
95
|
+
"handler": "./scripts/dispatch.js"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "agi-farm teardown",
|
|
99
|
+
"description": "Completely uninstall and teardown the active AGI Farm team",
|
|
100
|
+
"handler": "./scripts/teardown.js"
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agi-farm",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Multi-agent AI team builder for OpenClaw ā bootstrap complete teams with auto-dispatcher, dashboard, and infrastructure",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"agi-farm": "scripts/setup.js",
|
|
9
|
+
"agi-farm-teardown": "scripts/teardown.js"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "oabdelmaksoud",
|
|
13
|
+
"homepage": "https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/oabdelmaksoud/AGI-FARM-PLUGIN/issues"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"dashboard-dist",
|
|
24
|
+
"openclaw.plugin.json",
|
|
25
|
+
"server",
|
|
26
|
+
"scripts",
|
|
27
|
+
"templates",
|
|
28
|
+
"skills",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE.md"
|
|
31
|
+
],
|
|
32
|
+
"openclaw": {
|
|
33
|
+
"extensions": [
|
|
34
|
+
"dist/index.js"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=20.0.0"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build:dashboard": "cd dashboard-react && npm run build",
|
|
42
|
+
"build:all": "npm run build && npm run build:dashboard && rm -rf dashboard-dist && cp -r dashboard-react/dist dashboard-dist",
|
|
43
|
+
"prepublishOnly": "npm run build:all",
|
|
44
|
+
"prebuild": "rm -rf dist",
|
|
45
|
+
"build": "tsc",
|
|
46
|
+
"dev": "tsc --watch",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"test": "jest",
|
|
49
|
+
"start-dashboard": "node server/dashboard.js",
|
|
50
|
+
"lint": "eslint src --ext .ts .js"
|
|
51
|
+
},
|
|
52
|
+
"keywords": [
|
|
53
|
+
"openclaw",
|
|
54
|
+
"openclaw-plugin",
|
|
55
|
+
"openclaw-extension",
|
|
56
|
+
"multi-agent",
|
|
57
|
+
"agent-orchestration",
|
|
58
|
+
"agent-team",
|
|
59
|
+
"agentic-workflow",
|
|
60
|
+
"team-management",
|
|
61
|
+
"auto-dispatcher",
|
|
62
|
+
"dashboard",
|
|
63
|
+
"cli-wizard",
|
|
64
|
+
"agi",
|
|
65
|
+
"collaborative-ai",
|
|
66
|
+
"crewai",
|
|
67
|
+
"langgraph",
|
|
68
|
+
"autogen"
|
|
69
|
+
],
|
|
70
|
+
"dependencies": {
|
|
71
|
+
"ejs": "^3.1.10",
|
|
72
|
+
"express": "^4.21.2",
|
|
73
|
+
"sse.js": "^2.2.0",
|
|
74
|
+
"chokidar": "^4.0.1",
|
|
75
|
+
"commander": "^13.1.0",
|
|
76
|
+
"chalk": "^5.4.1",
|
|
77
|
+
"ora": "^8.1.1",
|
|
78
|
+
"inquirer": "^12.4.1",
|
|
79
|
+
"open": "^10.1.0"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@types/node": "^22.13.4",
|
|
83
|
+
"@types/express": "^5.0.0",
|
|
84
|
+
"@types/inquirer": "^9.0.8",
|
|
85
|
+
"@types/ejs": "^3.1.5",
|
|
86
|
+
"typescript": "^5.7.2",
|
|
87
|
+
"eslint": "^9.21.0",
|
|
88
|
+
"@eslint/js": "^9.21.0",
|
|
89
|
+
"typescript-eslint": "^8.24.1",
|
|
90
|
+
"jest": "^29.7.0",
|
|
91
|
+
"@types/jest": "^29.5.14",
|
|
92
|
+
"ts-jest": "^29.2.5"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import os from 'os';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const DASHBOARD_JS = path.join(os.homedir(), '.openclaw', 'extensions', 'agi-farm', 'server', 'dashboard.js');
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const noBrowser = args.includes('--no-browser');
|
|
14
|
+
const portIndex = args.indexOf('--port');
|
|
15
|
+
const port = portIndex !== -1 ? parseInt(args[portIndex + 1], 10) || 8080 : 8080;
|
|
16
|
+
|
|
17
|
+
// ANSI color codes
|
|
18
|
+
const cyan = '\x1b[36m';
|
|
19
|
+
const dim = '\x1b[2m';
|
|
20
|
+
const reset = '\x1b[0m';
|
|
21
|
+
|
|
22
|
+
console.log(`\n${cyan}š AGI Farm ā Dashboard${reset}\n`);
|
|
23
|
+
|
|
24
|
+
// Build args for dashboard.js
|
|
25
|
+
const dashboardArgs = [];
|
|
26
|
+
if (noBrowser) dashboardArgs.push('--no-browser');
|
|
27
|
+
if (portIndex !== -1) {
|
|
28
|
+
dashboardArgs.push('--port', String(port));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
console.log(`${dim}Starting dashboard on http://127.0.0.1:${port}${reset}`);
|
|
32
|
+
console.log(`${dim}Press Ctrl+C to stop${reset}\n`);
|
|
33
|
+
|
|
34
|
+
// Run dashboard server
|
|
35
|
+
const proc = spawn('node', [DASHBOARD_JS, ...dashboardArgs], { stdio: 'inherit' });
|
|
36
|
+
|
|
37
|
+
proc.on('error', (err) => {
|
|
38
|
+
console.error(`\x1b[31mError:${reset}`, err.message);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
proc.on('close', (code) => {
|
|
43
|
+
if (code !== 0 && code !== null) {
|
|
44
|
+
console.log(`\x1b[31m\nDashboard exited with code ${code}${reset}\n`);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import os from 'os';
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import { spawn } from 'child_process';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
|
|
12
|
+
const DISPATCH_PY = path.join(os.homedir(), '.openclaw', 'skills', 'agi-farm', 'scripts', 'auto-dispatch.py');
|
|
13
|
+
|
|
14
|
+
if (!fs.existsSync(DISPATCH_PY)) {
|
|
15
|
+
console.error(chalk.red('Error: AGI Farm python skill not found at ' + DISPATCH_PY));
|
|
16
|
+
console.log(chalk.yellow('Please install the skill first from the openclaw-skills repository.'));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const execute = args.includes('--execute');
|
|
22
|
+
|
|
23
|
+
console.log(chalk.cyan.bold('\nā” AGI Farm ā Auto-Dispatcher\n'));
|
|
24
|
+
|
|
25
|
+
if (!execute) {
|
|
26
|
+
console.log(chalk.yellow('Dry-run mode (preview only)'));
|
|
27
|
+
console.log(chalk.dim('Use --execute to run\n'));
|
|
28
|
+
} else {
|
|
29
|
+
console.log(chalk.green('Execute mode'));
|
|
30
|
+
console.log(chalk.dim('Firing agent sessions for pending tasks...\n'));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Run Python dispatcher
|
|
34
|
+
const proc = spawn('python3', [DISPATCH_PY, ...args], { stdio: 'inherit' });
|
|
35
|
+
|
|
36
|
+
proc.on('error', (err) => {
|
|
37
|
+
console.error(chalk.red('Error:'), err.message);
|
|
38
|
+
console.log(chalk.yellow('Make sure Python 3 is installed'));
|
|
39
|
+
process.exit(1);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
proc.on('close', (code) => {
|
|
43
|
+
if (code === 0) {
|
|
44
|
+
console.log(chalk.dim('\nDone.\n'));
|
|
45
|
+
} else {
|
|
46
|
+
console.log(chalk.red(`\nDispatcher exited with code ${code}\n`));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* AGI Farm Export - Push bundle to GitHub
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { spawnSync } from 'child_process';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import os from 'os';
|
|
10
|
+
import chalk from 'chalk';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
|
|
13
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
+
const __dirname = path.dirname(__filename);
|
|
15
|
+
|
|
16
|
+
const WORKSPACE = path.join(os.homedir(), '.openclaw', 'workspace');
|
|
17
|
+
const BUNDLE_DIR = path.join(WORKSPACE, 'agi-farm-bundle');
|
|
18
|
+
|
|
19
|
+
console.log(chalk.cyan.bold('\nš¤ AGI Farm ā Export to GitHub\n'));
|
|
20
|
+
|
|
21
|
+
// Check for bundle
|
|
22
|
+
if (!fs.existsSync(BUNDLE_DIR)) {
|
|
23
|
+
console.error(chalk.red('Error: Bundle not found at'), BUNDLE_DIR);
|
|
24
|
+
console.log(chalk.yellow('Run /agi-farm setup first'));
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Check for git
|
|
29
|
+
const gitDir = path.join(BUNDLE_DIR, '.git');
|
|
30
|
+
if (!fs.existsSync(gitDir)) {
|
|
31
|
+
console.log(chalk.yellow('No git repository found in bundle'));
|
|
32
|
+
console.log(chalk.dim('Run /agi-farm setup with GitHub option to create one'));
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
// Add all changes
|
|
38
|
+
console.log(chalk.dim('Staging changes...'));
|
|
39
|
+
spawnSync('git', ['add', '-A'], { stdio: 'inherit', cwd: BUNDLE_DIR });
|
|
40
|
+
|
|
41
|
+
// Commit
|
|
42
|
+
const date = new Date().toISOString().split('T')[0];
|
|
43
|
+
console.log(chalk.dim('Committing...'));
|
|
44
|
+
const commitResult = spawnSync('git', ['commit', '-m', `export: ${date}`], {
|
|
45
|
+
encoding: 'utf-8',
|
|
46
|
+
stdio: 'inherit',
|
|
47
|
+
cwd: BUNDLE_DIR
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (commitResult.status !== 0) {
|
|
51
|
+
console.log(chalk.yellow('Nothing to commit'));
|
|
52
|
+
process.exit(0);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Push
|
|
56
|
+
console.log(chalk.dim('Pushing to remote...'));
|
|
57
|
+
const pushResult = spawnSync('git', ['push'], { stdio: 'inherit', cwd: BUNDLE_DIR });
|
|
58
|
+
|
|
59
|
+
if (pushResult.status === 0) {
|
|
60
|
+
console.log(chalk.green('\nā
Bundle exported to GitHub'));
|
|
61
|
+
} else {
|
|
62
|
+
console.log(chalk.yellow('Push failed'));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Get remote URL
|
|
66
|
+
try {
|
|
67
|
+
const urlResult = spawnSync('git', ['remote', 'get-url', 'origin'], {
|
|
68
|
+
encoding: 'utf-8',
|
|
69
|
+
cwd: BUNDLE_DIR
|
|
70
|
+
});
|
|
71
|
+
if (urlResult.status === 0) {
|
|
72
|
+
const url = urlResult.stdout.trim();
|
|
73
|
+
console.log(chalk.dim(`\nRemote: ${url}\n`));
|
|
74
|
+
}
|
|
75
|
+
} catch { }
|
|
76
|
+
|
|
77
|
+
} catch (err) {
|
|
78
|
+
console.error(chalk.red('Error exporting to GitHub'));
|
|
79
|
+
console.log(chalk.yellow('Make sure you have push access to the remote'));
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'child_process';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import os from 'os';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
|
|
12
|
+
const WORKSPACE = process.env.AGI_FARM_WORKSPACE || path.join(os.homedir(), '.openclaw', 'workspace');
|
|
13
|
+
const BUNDLE_DIR = path.join(WORKSPACE, 'agi-farm-bundle');
|
|
14
|
+
const GENERATE_PY = path.join(os.homedir(), '.openclaw', 'skills', 'agi-farm', 'generate.py');
|
|
15
|
+
|
|
16
|
+
const args = process.argv.slice(2);
|
|
17
|
+
const force = args.includes('--force');
|
|
18
|
+
|
|
19
|
+
console.log(chalk.cyan.bold('\nš AGI Farm ā Rebuild Workspace\n'));
|
|
20
|
+
|
|
21
|
+
// Check for team.json
|
|
22
|
+
const teamJson = path.join(BUNDLE_DIR, 'team.json');
|
|
23
|
+
if (!fs.existsSync(teamJson)) {
|
|
24
|
+
console.error(chalk.red('Error: team.json not found at'), teamJson);
|
|
25
|
+
console.log(chalk.yellow('Run /agi-farm setup first'));
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Check for generate.py
|
|
30
|
+
if (!fs.existsSync(GENERATE_PY)) {
|
|
31
|
+
console.error(chalk.red('Error: generate.py not found at'), GENERATE_PY);
|
|
32
|
+
console.log(chalk.yellow('The AGI Farm skill must be installed'));
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log(chalk.dim('Regenerating workspace files...'));
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const spawnArgs = [
|
|
40
|
+
GENERATE_PY,
|
|
41
|
+
'--team-json', teamJson,
|
|
42
|
+
'--output', WORKSPACE,
|
|
43
|
+
'--all-agents',
|
|
44
|
+
'--shared',
|
|
45
|
+
];
|
|
46
|
+
if (!force) spawnArgs.push('--no-overwrite');
|
|
47
|
+
|
|
48
|
+
const result = spawnSync('python3', spawnArgs, {
|
|
49
|
+
encoding: 'utf-8',
|
|
50
|
+
stdio: 'inherit',
|
|
51
|
+
timeout: 60000,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (result.status === 0) {
|
|
55
|
+
console.log(chalk.green('\nā
Workspace rebuilt successfully'));
|
|
56
|
+
console.log(chalk.dim('\nNote: Existing files were preserved (--no-overwrite)'));
|
|
57
|
+
console.log(chalk.dim('Use --force to overwrite everything\n'));
|
|
58
|
+
} else {
|
|
59
|
+
console.error(chalk.red('Error rebuilding workspace'));
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
} catch (err) {
|
|
63
|
+
console.error(chalk.red('Error rebuilding workspace'));
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|