import { join } from 'node:path';
function joinRel(base, namespace) {
    return namespace && namespace.length > 0
        ? join(base, ...namespace)
        : base;
}
export function buildRunPaths(cwd, slug, namespace) {
    const runRootRel = `.takt/runs/${slug}`;
    const reportsRel = joinRel(`${runRootRel}/reports`, namespace);
    const contextRel = joinRel(`${runRootRel}/context`, namespace);
    const contextTaskRel = join(contextRel, 'task');
    const contextTaskOrderRel = join(contextTaskRel, 'order.md');
    const contextKnowledgeRel = join(contextRel, 'knowledge');
    const contextPolicyRel = join(contextRel, 'policy');
    const contextPreviousResponsesRel = join(contextRel, 'previous_responses');
    const logsRel = `${runRootRel}/logs`;
    const metaRel = `${runRootRel}/meta.json`;
    return {
        slug,
        runRootRel,
        reportsRel,
        contextRel,
        contextTaskRel,
        contextTaskOrderRel,
        contextKnowledgeRel,
        contextPolicyRel,
        contextPreviousResponsesRel,
        logsRel,
        metaRel,
        runRootAbs: join(cwd, runRootRel),
        reportsAbs: join(cwd, reportsRel),
        contextAbs: join(cwd, contextRel),
        contextTaskAbs: join(cwd, contextTaskRel),
        contextTaskOrderAbs: join(cwd, contextTaskOrderRel),
        contextKnowledgeAbs: join(cwd, contextKnowledgeRel),
        contextPolicyAbs: join(cwd, contextPolicyRel),
        contextPreviousResponsesAbs: join(cwd, contextPreviousResponsesRel),
        logsAbs: join(cwd, logsRel),
        metaAbs: join(cwd, metaRel),
    };
}
//# sourceMappingURL=run-paths.js.map