mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
f8658f9fd8
- Update worker configs with current timestamps from aqe init --auto - Update worker registry version to 3.6.4 - Add claude-flow integration config - Add worker daemon start/stop scripts - Add v3 agents index, quality-criteria helpers, and SFDIPOT template - Update skills README Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
57 lines
2.2 KiB
JavaScript
57 lines
2.2 KiB
JavaScript
#!/usr/bin/env node
|
|
// AQE v3 Worker Daemon Startup Script (cross-platform)
|
|
// Generated by aqe init
|
|
// Starts the MCP server with background workers enabled
|
|
|
|
const { existsSync, readFileSync, writeFileSync, appendFileSync } = require('fs');
|
|
const { join } = require('path');
|
|
const { spawn } = require('child_process');
|
|
|
|
const projectRoot = join(__dirname, '..', '..');
|
|
const workersDir = join(projectRoot, '.agentic-qe', 'workers');
|
|
const pidFile = join(workersDir, 'daemon.pid');
|
|
const logFile = join(workersDir, 'daemon.log');
|
|
|
|
// Check if already running
|
|
if (existsSync(pidFile)) {
|
|
const pid = parseInt(readFileSync(pidFile, 'utf-8').trim(), 10);
|
|
try { process.kill(pid, 0); console.log('Daemon already running (PID: ' + pid + ')'); process.exit(0); } catch {}
|
|
}
|
|
|
|
const ts = new Date().toISOString();
|
|
appendFileSync(logFile, '[' + ts + '] Starting AQE v3 Worker Daemon...\n');
|
|
|
|
// Find the best way to run aqe-mcp
|
|
const candidates = [
|
|
join(projectRoot, 'node_modules', '.bin', 'aqe-mcp'),
|
|
join(projectRoot, 'node_modules', 'agentic-qe', 'v3', 'dist', 'mcp', 'bundle.js'),
|
|
];
|
|
|
|
let mcpCmd, mcpArgs;
|
|
const binCandidate = candidates.find(c => existsSync(c));
|
|
|
|
if (binCandidate && binCandidate.endsWith('bundle.js')) {
|
|
mcpCmd = process.execPath;
|
|
mcpArgs = [binCandidate];
|
|
} else if (binCandidate) {
|
|
mcpCmd = binCandidate;
|
|
mcpArgs = [];
|
|
} else {
|
|
mcpCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
|
|
mcpArgs = ['--yes', 'agentic-qe', 'mcp'];
|
|
}
|
|
|
|
appendFileSync(logFile, '[' + ts + '] Using: ' + mcpCmd + ' ' + mcpArgs.join(' ') + '\n');
|
|
|
|
const env = { ...process.env, AQE_PROJECT_ROOT: projectRoot, AQE_LEARNING_ENABLED: 'true', AQE_WORKERS_ENABLED: 'true', AQE_HTTP_PORT: '0' };
|
|
const child = spawn(mcpCmd, mcpArgs, { cwd: projectRoot, env, detached: true, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
child.stdout.on('data', d => appendFileSync(logFile, d));
|
|
child.stderr.on('data', d => appendFileSync(logFile, d));
|
|
child.unref();
|
|
|
|
writeFileSync(pidFile, String(child.pid));
|
|
appendFileSync(logFile, '[' + ts + '] Daemon started with PID: ' + child.pid + '\n');
|
|
console.log('AQE v3 Worker Daemon started (PID: ' + child.pid + ')');
|
|
console.log('Log file: ' + logFile);
|
|
console.log('To stop: node ' + join(workersDir, 'stop-daemon.cjs'));
|