"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWorkflowTemplateRepoRoot = getWorkflowTemplateRepoRoot;
exports.refreshWorkflowTemplateRepoRoot = refreshWorkflowTemplateRepoRoot;
function getWorkflowTemplateRepoRoot(context) {
    return context.workflowTemplateRepoRoot ?? context.cwd;
}
async function refreshWorkflowTemplateRepoRoot(context, options = {}) {
    if (!options.force && context.workflowTemplateRepoRoot) {
        return context.workflowTemplateRepoRoot;
    }
    if (!context.refreshWorkflowTemplateRepoRoot) {
        return getWorkflowTemplateRepoRoot(context);
    }
    const repoRoot = await context.refreshWorkflowTemplateRepoRoot();
    context.workflowTemplateRepoRoot = repoRoot;
    return repoRoot;
}
