import { mkdir } from 'node:fs/promises';
import { join } from 'node:path';
import { config } from '../config.js';
export function getRunsDir() {
    return process.env.BOTMUX_WORKFLOW_RUNS_DIR ?? join(config.session.dataDir, 'workflow-runs');
}
export function runDir(runId, baseDir = getRunsDir()) {
    return join(baseDir, runId);
}
export async function ensureRunDir(runId, baseDir = getRunsDir()) {
    const dir = runDir(runId, baseDir);
    await mkdir(dir, { recursive: true });
    return dir;
}
//# sourceMappingURL=runs-dir.js.map