"use strict";
/**
 * Central named constants for all tunable values.
 * Import from here instead of hardcoding magic numbers.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.MIRROR_MAX_ENTRIES = exports.MIRROR_STALE_MS = exports.ERROR_BODY_LIMIT = exports.GRACEFUL_SHUTDOWN_TIMEOUT_MS = exports.SESSION_SWEEP_INTERVAL_MS = exports.RATE_LIMIT_WINDOW_MS = exports.REMOTE_BASE_DELAY_MS = exports.REMOTE_MAX_RETRIES = exports.WS_DEBOUNCE_MS = exports.AUTO_SAVE_INTERVAL_MS = exports.MAX_PASSWORD_LEN = exports.MIN_PASSWORD_LEN = exports.MAX_ATTACHMENT_FILENAME_LEN = exports.MAX_PROJECT_ID_LEN = exports.MAX_LINK_KIND_LEN = exports.MAX_TARGET_NODE_ID_LEN = exports.MAX_SKILL_TRIGGERS_COUNT = exports.MAX_SKILL_TRIGGER_LEN = exports.MAX_SKILL_STEPS_COUNT = exports.MAX_SKILL_STEP_LEN = exports.MAX_ASSIGNEE_LEN = exports.MAX_DESCRIPTION_LEN = exports.MAX_SEARCH_TOP_K = exports.MAX_SEARCH_QUERY_LEN = exports.MAX_TAGS_COUNT = exports.MAX_TAG_LEN = exports.MAX_NOTE_CONTENT_LEN = exports.MAX_TITLE_LEN = exports.INDEXER_PREVIEW_LEN = exports.CONTENT_PREVIEW_LEN = exports.LIST_PAGE_SIZE_TABLE = exports.LIST_PAGE_SIZE = exports.LIST_LIMIT_SMALL = exports.SIGNATURE_MAX_LEN = exports.MAX_UPLOAD_SIZE = exports.MAX_BODY_SIZE = exports.BM25_BODY_MAX_CHARS = exports.FILE_SEARCH_TOP_K = exports.SEARCH_MIN_SCORE_FILES = exports.SEARCH_MIN_SCORE_CODE = exports.SEARCH_MIN_SCORE = exports.CODE_EDGE_DECAY = exports.SEARCH_BFS_DECAY = exports.SEARCH_MAX_RESULTS = exports.SEARCH_BFS_DEPTH = exports.SEARCH_TOP_K = exports.RRF_K = exports.BM25_IDF_OFFSET = exports.BM25_B = exports.BM25_K1 = void 0;
exports.GRAPH_DATA_VERSION = exports.WIKI_MAX_DEPTH = exports.DEFAULT_EMBEDDING_CACHE_SIZE = exports.MIRROR_MTIME_TOLERANCE_MS = void 0;
// ---------------------------------------------------------------------------
// Search — BM25, RRF, BFS
// ---------------------------------------------------------------------------
exports.BM25_K1 = 1.2;
exports.BM25_B = 0.75;
exports.BM25_IDF_OFFSET = 0.5;
exports.RRF_K = 60;
exports.SEARCH_TOP_K = 5;
exports.SEARCH_BFS_DEPTH = 1;
exports.SEARCH_MAX_RESULTS = 5;
exports.SEARCH_BFS_DECAY = 0.8;
/** Edge-specific BFS decay for code graph — stronger edges propagate more score. */
exports.CODE_EDGE_DECAY = {
    contains: 0.95, // file→declaration, class→method — nearly the same entity
    extends: 0.85, // class inheritance — strong semantic link
    implements: 0.85, // interface implementation — strong semantic link
    imports: 0.70, // cross-file import — weaker dependency
};
exports.SEARCH_MIN_SCORE = 0.5;
exports.SEARCH_MIN_SCORE_CODE = 0.3;
exports.SEARCH_MIN_SCORE_FILES = 0.3;
exports.FILE_SEARCH_TOP_K = 10;
exports.BM25_BODY_MAX_CHARS = 2000;
// ---------------------------------------------------------------------------
// Limits — sizes, counts, truncation
// ---------------------------------------------------------------------------
exports.MAX_BODY_SIZE = 10 * 1024 * 1024; // 10 MB
exports.MAX_UPLOAD_SIZE = 50 * 1024 * 1024; // 50 MB (multer)
exports.SIGNATURE_MAX_LEN = 300;
exports.LIST_LIMIT_SMALL = 10;
exports.LIST_PAGE_SIZE = 25;
exports.LIST_PAGE_SIZE_TABLE = 50;
exports.CONTENT_PREVIEW_LEN = 500;
exports.INDEXER_PREVIEW_LEN = 200;
// ---------------------------------------------------------------------------
// Validation — REST API schema limits
// ---------------------------------------------------------------------------
exports.MAX_TITLE_LEN = 500;
exports.MAX_NOTE_CONTENT_LEN = 1_000_000;
exports.MAX_TAG_LEN = 100;
exports.MAX_TAGS_COUNT = 100;
exports.MAX_SEARCH_QUERY_LEN = 10_000;
exports.MAX_SEARCH_TOP_K = 500;
exports.MAX_DESCRIPTION_LEN = 500_000;
exports.MAX_ASSIGNEE_LEN = 100;
exports.MAX_SKILL_STEP_LEN = 10_000;
exports.MAX_SKILL_STEPS_COUNT = 100;
exports.MAX_SKILL_TRIGGER_LEN = 500;
exports.MAX_SKILL_TRIGGERS_COUNT = 50;
exports.MAX_TARGET_NODE_ID_LEN = 500;
exports.MAX_LINK_KIND_LEN = 100;
exports.MAX_PROJECT_ID_LEN = 200;
exports.MAX_ATTACHMENT_FILENAME_LEN = 255;
exports.MIN_PASSWORD_LEN = 8;
exports.MAX_PASSWORD_LEN = 256;
// ---------------------------------------------------------------------------
// Timing — intervals, retries, timeouts
// ---------------------------------------------------------------------------
exports.AUTO_SAVE_INTERVAL_MS = 30_000;
exports.WS_DEBOUNCE_MS = 1000;
exports.REMOTE_MAX_RETRIES = 3;
exports.REMOTE_BASE_DELAY_MS = 200;
exports.RATE_LIMIT_WINDOW_MS = 60_000;
exports.SESSION_SWEEP_INTERVAL_MS = 60_000;
exports.GRACEFUL_SHUTDOWN_TIMEOUT_MS = 15_000;
exports.ERROR_BODY_LIMIT = 500;
// ---------------------------------------------------------------------------
// Mirror
// ---------------------------------------------------------------------------
exports.MIRROR_STALE_MS = 10_000;
exports.MIRROR_MAX_ENTRIES = 10_000;
exports.MIRROR_MTIME_TOLERANCE_MS = 100;
// ---------------------------------------------------------------------------
// Embedder
// ---------------------------------------------------------------------------
exports.DEFAULT_EMBEDDING_CACHE_SIZE = 10_000;
// ---------------------------------------------------------------------------
// Parser
// ---------------------------------------------------------------------------
exports.WIKI_MAX_DEPTH = 10;
// ---------------------------------------------------------------------------
// Graph data version — bump when changing what gets embedded, stored format,
// or any schema change that requires re-indexing
// ---------------------------------------------------------------------------
exports.GRAPH_DATA_VERSION = 2; // v2: body in code embeddings, path normalization, hybrid file search
