Files
EJClaw/setup/runners.ts
Eyejoker 35ba7cb5ba chore: replace all node/npm/tsx references with bun across codebase
- Source: setup/service.ts, runners.ts, agent-runner.ts error messages
- Scripts: restart-stack.sh, run-migrations.ts → bun
- Bootstrap: setup.sh check_node→check_bun, npm install→bun install
- Docs: CLAUDE.md, README.md, all SKILL.md files
- Tests: service.test.ts, restart-stack.test.ts expectations updated
2026-03-31 00:10:23 +09:00

58 lines
1.3 KiB
TypeScript

/**
* Step: runners — Build the Claude and Codex runner packages.
*/
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('bun 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);
}