Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
Fix build scripts and add Go detection for WhatsApp server
trohitgcd63314ed27e
diff --git a/package.json b/package.jsonindex e7c4a5a4..3306c42e 100644--- a/package.json+++ b/package.json@@ -17,7 +17,7 @@"whatsapp:status": "cd server/whatsapp-rpc && npm run status","whatsapp:api": "cd server/whatsapp-rpc && npm run api","whatsapp:build": "cd server/whatsapp-rpc && npm run build",- "build": "node -e \"const fs=require('fs'),p='.env';if(!fs.existsSync(p))fs.copyFileSync('.env.template',p)\" && echo '[1/4] Installing root deps...' && npm ci && echo '[2/4] Building client...' && cd client && npm run build && echo '[3/4] Installing Python deps...' && cd ../server && uv venv && uv sync && echo '[4/4] Installing WhatsApp deps...' && cd whatsapp-rpc && npm ci && echo 'Build complete.'",+ "build": "node -e \"const fs=require('fs'),p='.env';if(!fs.existsSync(p))fs.copyFileSync('.env.template',p)\" && echo '[1/5] Installing root deps...' && npm ci && echo '[2/5] Building client...' && cd client && npm run build && echo '[3/5] Installing Python deps...' && cd ../server && uv venv && uv sync && echo '[4/5] Installing WhatsApp deps...' && cd whatsapp-rpc && npm ci && echo '[5/5] Building WhatsApp server...' && npm run build && echo 'Build complete.'","clean": "node scripts/clean.js","start": "node scripts/start.js","stop": "node scripts/stop.js",diff --git a/scripts/clean.js b/scripts/clean.jsindex 9d2ed2bf..efe712c5 100644--- a/scripts/clean.js+++ b/scripts/clean.js@@ -14,6 +14,7 @@ const targets = ['client/.vite','server/whatsapp-rpc/node_modules','server/whatsapp-rpc/dist',+ 'server/whatsapp-rpc/data','server/data','server/.venv',];diff --git a/server/whatsapp-rpc/scripts/cli.js b/server/whatsapp-rpc/scripts/cli.jsindex 9f985ff9..5be2dea6 100644--- a/server/whatsapp-rpc/scripts/cli.js+++ b/server/whatsapp-rpc/scripts/cli.js@@ -43,10 +43,25 @@ const py = () => {catch { try { execSync('python3 --version', { stdio: 'ignore' }); return 'python3'; } catch { return null; } }};+const hasGo = () => {+ try { execSync('go version', { stdio: 'ignore' }); return true; }+ catch { return false; }+};+async function api(foreground = false) {if (await portUp(API_PORT)) { log(`API already on ${API_PORT}`, 'yellow'); return; }const bin = join(BIN_DIR, BIN);- if (!existsSync(bin)) { log('Building...', 'yellow'); await build(); }+ if (!existsSync(bin)) {+ if (!hasGo()) {+ log('Go is not installed. Please either:', 'red');+ log(' 1. Install Go: https://go.dev/dl/', 'yellow');+ log(' 2. Or run "npm run build" on a machine with Go installed', 'yellow');+ log(' 3. Or copy the pre-built binary to: ' + bin, 'yellow');+ process.exit(1);+ }+ log('Building...', 'yellow');+ await build();+ }if (foreground) {// Run in foreground - will receive Ctrl+C signals@@ -82,6 +97,10 @@ async function status() {}async function build() {+ if (!hasGo()) {+ log('Go is not installed. Install from: https://go.dev/dl/', 'red');+ process.exit(1);+ }const bin = join(BIN_DIR, BIN);if (!existsSync(BIN_DIR)) { await execa('mkdir', ['-p', BIN_DIR]); }if (existsSync(bin)) unlinkSync(bin);