"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DERIVED_CONFIG_FIELDS = exports.PERSISTED_CONFIG_KEYS = exports.CONFIG_FIELD_CONTRACTS = exports.BUILT_IN_CONFIG_DEFAULTS = void 0;
const node_path_1 = __importDefault(require("node:path"));
const runtime_contract_1 = require("../runtime/runtime-contract");
exports.BUILT_IN_CONFIG_DEFAULTS = {
    planning_root: node_path_1.default.posix.join(runtime_contract_1.DAY_SHIFT_DIRECTORY_NAME, 'planning'),
    spec_root: 'specs',
    spec_index: node_path_1.default.posix.join(runtime_contract_1.DAY_SHIFT_DIRECTORY_NAME, 'specs', 'index.json'),
    agent_entrypoint: node_path_1.default.posix.join(runtime_contract_1.DAY_SHIFT_DIRECTORY_NAME, runtime_contract_1.AGENT_ENTRYPOINT_FILE_NAME),
    default_readiness: 'needs more evidence',
    config_schema_version: 1,
    spec_index_schema_version: 1,
    template_version: 1,
    prompt_version: 1,
    prompt_root: node_path_1.default.posix.join(runtime_contract_1.DAY_SHIFT_DIRECTORY_NAME, 'prompts'),
    prompt_latest_root: node_path_1.default.posix.join(runtime_contract_1.DAY_SHIFT_DIRECTORY_NAME, 'prompts', 'latest'),
    prompt_user_root: node_path_1.default.posix.join(runtime_contract_1.DAY_SHIFT_DIRECTORY_NAME, 'prompts', 'user'),
    cli_command: 'day-shift',
    cli_resolution: 'installed',
    cli_verified: true,
    cli_verified_via: 'day-shift --help',
    monorepo_projects: [],
};
exports.CONFIG_FIELD_CONTRACTS = {
    planning_root: {
        key: 'planning_root',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    spec_root: {
        key: 'spec_root',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    spec_index: {
        key: 'spec_index',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    agent_entrypoint: {
        key: 'agent_entrypoint',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    default_readiness: {
        key: 'default_readiness',
        mutability: 'mutable-shared',
        writableThroughConfigSet: true,
        allowedLayers: ['defaults', 'repository'],
    },
    config_schema_version: {
        key: 'config_schema_version',
        mutability: 'read-only-metadata',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    spec_index_schema_version: {
        key: 'spec_index_schema_version',
        mutability: 'read-only-metadata',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    template_version: {
        key: 'template_version',
        mutability: 'read-only-metadata',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    prompt_version: {
        key: 'prompt_version',
        mutability: 'read-only-metadata',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    prompt_root: {
        key: 'prompt_root',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    prompt_latest_root: {
        key: 'prompt_latest_root',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    prompt_user_root: {
        key: 'prompt_user_root',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    cli_command: {
        key: 'cli_command',
        mutability: 'mutable-shared',
        writableThroughConfigSet: true,
        allowedLayers: ['defaults', 'repository'],
    },
    cli_resolution: {
        key: 'cli_resolution',
        mutability: 'mutable-shared',
        writableThroughConfigSet: true,
        allowedLayers: ['defaults', 'repository'],
    },
    cli_verified: {
        key: 'cli_verified',
        mutability: 'mutable-shared',
        writableThroughConfigSet: true,
        allowedLayers: ['defaults', 'repository'],
    },
    cli_verified_via: {
        key: 'cli_verified_via',
        mutability: 'mutable-shared',
        writableThroughConfigSet: true,
        allowedLayers: ['defaults', 'repository'],
    },
    monorepo_projects: {
        key: 'monorepo_projects',
        mutability: 'repository-owned',
        writableThroughConfigSet: false,
        allowedLayers: ['defaults', 'repository'],
    },
    version: {
        key: 'version',
        mutability: 'mutable-shared',
        writableThroughConfigSet: true,
        allowedLayers: ['repository', 'local'],
    },
    editor: {
        key: 'editor',
        mutability: 'local-only',
        writableThroughConfigSet: true,
        allowedLayers: ['defaults', 'local'],
    },
};
exports.PERSISTED_CONFIG_KEYS = Object.freeze(Object.keys(exports.CONFIG_FIELD_CONTRACTS));
exports.DERIVED_CONFIG_FIELDS = Object.freeze([
    'repositoryRoot',
    'dayShiftDirectoryPath',
    'sharedConfigPath',
    'localConfigPath',
    'planningRootPath',
    'specRootPath',
    'specIndexPath',
    'agentEntrypointPath',
    'promptRootPath',
    'promptLatestRootPath',
    'promptUserRootPath',
]);
