/**
 * Shared type and interface definitions for OrchestratorEngine.
 * Extracted from orchestrator.ts (Phase 3 split) to keep per-file size honest.
 * Re-exported from the orchestrator barrel so callers keep the same import path.
 */
// ─── Module-level constants (used by both scoring + orchestrator) ──────────
export const MAX_AUTONOMY_HISTORY = 24;
export const MAX_DISCOVERED_FILES = 32;
export const ABSOLUTE_SECONDARY_MIN = 0.3;
// Source-like file extensions worth indexing. Covers JS/TS, Python, Go, Rust,
// JVM langs, native, web, configs and prose. NEXUS_NGRAM_INDEX_ALL=1 disables
// the allowlist (useful for diagnostics on non-mainstream repos).
export const DISCOVERY_EXTENSIONS = new Set([
    '.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs',
    '.py', '.go', '.rs', '.java', '.kt', '.swift',
    '.cpp', '.cc', '.c', '.h', '.hpp', '.cs',
    '.rb', '.php',
    '.md', '.mdx',
    '.json', '.yaml', '.yml', '.toml',
    '.sql', '.sh',
    '.css', '.scss', '.html',
]);
// Directories the indexer must skip — generated artefacts, dependency caches,
// virtualenvs, build outputs, and Nexus's own working dirs.
export const DISCOVERY_IGNORES = new Set([
    '.git',
    'node_modules',
    'dist',
    'build',
    'out',
    'coverage',
    '.next',
    '.turbo',
    '.playwright-cli',
    '.cache',
    'vendor',
    'target',
    '.venv',
    '__pycache__',
    'tmp',
    '.agents',
    '.agent',
]);
// Specific filenames to skip even when they match an allowed extension.
// Lockfiles and large generated manifests blow up trigram indexes without
// any retrieval value.
export const DISCOVERY_FILENAME_SKIPS = new Set([
    'package-lock.json',
    'pnpm-lock.yaml',
    'yarn.lock',
    'bun.lockb',
    'composer.lock',
    'poetry.lock',
    'Pipfile.lock',
    'Cargo.lock',
    'Gemfile.lock',
    'go.sum',
]);
// Binary / media / archive extensions never to read into the indexer even
// when the user passes NEXUS_NGRAM_INDEX_ALL=1 — these contain no useful
// trigrams and inflate the WAL when accidentally included.
export const DISCOVERY_BINARY_EXTENSIONS = new Set([
    '.png', '.jpg', '.jpeg', '.gif', '.webp', '.bmp', '.ico', '.tiff',
    '.mp3', '.mp4', '.mov', '.avi', '.mkv', '.webm', '.wav', '.flac', '.ogg',
    '.zip', '.tar', '.gz', '.tgz', '.bz2', '.xz', '.7z', '.rar',
    '.pdf', '.psd', '.ai',
    '.so', '.dll', '.dylib', '.a', '.o', '.node', '.exe', '.bin',
    '.wasm', '.class', '.jar', '.pyc', '.pyo',
    '.lockb',
]);
export const REPO_SEARCH_HEAD_BYTES = 2_000;
/** Default per-file byte cap for the ngram indexer. Override with
 *  NEXUS_NGRAM_MAX_FILE_BYTES. Files above this are skipped (not truncated). */
export const DISCOVERY_DEFAULT_MAX_FILE_BYTES = 256_000;
