Files
EJClaw/setup/container.ts
Eyejoker 7e77f37948 refactor: extract dashboard and message-runtime from index.ts
- Extract dashboard code into src/dashboard.ts
- Extract message runtime into src/message-runtime.ts
- Improve group-queue with better concurrency handling
- Update agent-runner with enhanced env/config passing
- Simplify DB operations and cleanup unused code
- Update README for Codex SDK architecture
2026-03-16 05:08:19 +09:00

59 lines
1.4 KiB
TypeScript

/**
* Step: runners — Build agent runners (no container needed).
* Agents run as direct host processes.
*/
import { execSync } from 'child_process';
import fs from 'fs';
import path from 'path';
import { logger } from '../src/logger.js';
import { emitStatus } from './status.js';
export async function run(_args: string[]): Promise<void> {
const projectRoot = process.cwd();
// Build agent runners
let buildOk = false;
logger.info('Building agent runners');
try {
execSync('npm run build:runners', {
cwd: projectRoot,
stdio: ['ignore', 'pipe', 'pipe'],
});
buildOk = true;
logger.info('Agent runners build succeeded');
} catch (err) {
logger.error({ err }, 'Agent runners build failed');
}
// Verify runner entry points exist
const agentRunner = path.join(
projectRoot,
'runners',
'agent-runner',
'dist',
'index.js',
);
const codexRunner = path.join(
projectRoot,
'runners',
'codex-runner',
'dist',
'index.js',
);
const agentRunnerOk = fs.existsSync(agentRunner);
const codexRunnerOk = fs.existsSync(codexRunner);
const status = buildOk && agentRunnerOk ? 'success' : 'failed';
emitStatus('SETUP_RUNNERS', {
BUILD_OK: buildOk,
AGENT_RUNNER: agentRunnerOk,
CODEX_RUNNER: codexRunnerOk,
STATUS: status,
LOG: 'logs/setup.log',
});
if (status === 'failed') process.exit(1);
}