import path from 'node:path';
import { writeJsonAtomic } from '../fsx.js';
import { buildCodexAppHarnessMatrixFromNative } from '../codex-native/codex-native-harness-compat.js';
export async function buildCodexAppHarnessMatrix(input = { root: process.cwd() }) {
    const matrix = await buildCodexAppHarnessMatrixFromNative(input);
    await writeCodexAppHarnessMatrix(path.resolve(input.root || process.cwd()), matrix, input.missionDir);
    return matrix;
}
export async function writeCodexAppHarnessMatrix(root, matrix, missionDir) {
    await writeJsonAtomic(path.join(root, '.sneakoscope', 'reports', 'codex-app-harness-matrix.json'), matrix);
    if (missionDir)
        await writeJsonAtomic(path.join(missionDir, 'codex-app-harness-matrix.json'), matrix).catch(() => undefined);
}
//# sourceMappingURL=codex-app-harness-matrix.js.map