"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ISSUE_OVERRIDE_OPTION_REGISTRY_BY_PATH = exports.ISSUE_OVERRIDE_OPTION_REGISTRY_BY_FLAG = exports.ISSUE_OVERRIDE_OPTION_REGISTRY = void 0;
const issue_completion_1 = require("../config/issue-completion");
const types_1 = require("./types");
exports.ISSUE_OVERRIDE_OPTION_REGISTRY = [
    {
        flag: "issue-completion-target",
        path: "issueCompletion.target",
        kind: "enum",
        enumValues: issue_completion_1.ISSUE_COMPLETION_TARGET_VALUES,
        parseCliValue: issue_completion_1.parseIssueCompletionTargetCliValue,
    },
    {
        flag: "pr-review",
        path: "issueCompletion.pullRequest.reviewPolicy",
        kind: "enum",
        enumValues: issue_completion_1.PULL_REQUEST_REVIEW_POLICY_VALUES,
        parseCliValue: issue_completion_1.parsePullRequestReviewPolicyCliValue,
    },
    {
        flag: "pr-merge",
        path: "issueCompletion.pullRequest.mergePolicy",
        kind: "enum",
        enumValues: issue_completion_1.PULL_REQUEST_MERGE_POLICY_VALUES,
        parseCliValue: issue_completion_1.parsePullRequestMergePolicyCliValue,
    },
    {
        flag: "max-ai-runs",
        path: "aiRunLimits.maxRuns",
        kind: "integer",
        min: 0,
    },
    {
        flag: "max-ai-hours",
        path: "aiRunLimits.maxHours",
        kind: "number",
        min: 0,
        allowDisable: true,
    },
    {
        flag: "recurring-max-active-children",
        path: "recurring.maxActiveChildren",
        kind: "integer",
        min: 1,
    },
    {
        flag: "recurring-update-child-title-after-plan",
        path: "recurring.updateChildTitleAfterPlan",
        kind: "boolean",
    },
    {
        flag: "followup-proposal",
        path: "followup.proposalPolicy",
        kind: "enum",
        enumValues: types_1.FOLLOWUP_PROPOSAL_POLICIES,
    },
    {
        flag: "followup-proposal-approval",
        path: "followup.proposalApproval",
        kind: "enum",
        enumValues: types_1.FOLLOWUP_PROPOSAL_APPROVALS,
    },
    {
        flag: "followup-preferred-workflow-template",
        path: "followup.preferredWorkflowTemplates",
        kind: "workflow-template-list",
        repeatable: true,
    },
    {
        flag: "followup-auto-maintain-templates",
        path: "followup.autoMaintainTemplates",
        kind: "boolean",
    },
    {
        flag: "followup-max-main-work-issues",
        path: "followup.maxIssuesPerSource.mainWork",
        kind: "integer",
        min: 0,
        max: 5,
    },
    {
        flag: "followup-max-maintenance-issues",
        path: "followup.maxIssuesPerSource.maintenance",
        kind: "integer",
        min: 0,
        max: 5,
    },
    {
        flag: "default-reviewers",
        path: "repositoryHost.pullRequest.defaultReviewers",
        kind: "string-array",
        repeatable: true,
    },
    {
        flag: "default-worker",
        path: "workers.default",
        kind: "worker",
    },
    {
        flag: "thinking-worker",
        path: "workers.thinking",
        kind: "worker",
    },
    {
        flag: "foreign-approval-scope",
        path: "foreignIssueApprovalScope",
        kind: "enum",
        enumValues: ["external_only", "all_foreign"],
    },
    {
        flag: "workflow-start-new-plan",
        path: "approvals.workflowStart.newPlan",
        kind: "enum",
        enumValues: ["auto", "confirm", "conservative", "aggressive"],
    },
    {
        flag: "workflow-start-replan",
        path: "approvals.workflowStart.replan",
        kind: "enum",
        enumValues: ["auto", "confirm", "conservative", "aggressive"],
    },
    {
        flag: "workflow-start-scope",
        path: "approvals.workflowStart.scope",
        kind: "enum",
        enumValues: ["issue_only", "issue_and_pr"],
    },
    {
        flag: "requirements-setup-skills",
        path: "approvals.requirementsSetup.skills",
        kind: "enum",
        enumValues: ["auto", "confirm"],
    },
    {
        flag: "requirements-setup-mcp",
        path: "approvals.requirementsSetup.mcp",
        kind: "enum",
        enumValues: ["auto", "confirm"],
    },
];
const registryByFlagEntries = exports.ISSUE_OVERRIDE_OPTION_REGISTRY.map((row) => [row.flag, row]);
const registryByPathEntries = exports.ISSUE_OVERRIDE_OPTION_REGISTRY.map((row) => [row.path, row]);
exports.ISSUE_OVERRIDE_OPTION_REGISTRY_BY_FLAG = new Map(registryByFlagEntries);
exports.ISSUE_OVERRIDE_OPTION_REGISTRY_BY_PATH = new Map(registryByPathEntries);
