import { parsePositiveInt } from '../cli-validation.js';
import { DEFAULT_ENTITY_BOUNDS } from './entity/types.js';
/** Add the public entity-intelligence bounds without letting command defaults diverge. */
export function addEntityBoundsCliOptions(command) {
    command
        .option('--max-commits <n>', 'newest full-DAG commits retained')
        .option('--max-files-per-commit <n>', 'changed paths retained for bounded projections')
        .option('--max-blob-bytes <n>', 'maximum bytes read from one blob')
        .option('--max-blob-lines <n>', 'maximum lines parsed from one blob')
        .option('--max-total-blob-bytes <n>', 'maximum unique blob bytes read')
        .option('--max-batch-bytes <n>', 'maximum object bytes read per cat-file batch')
        .option('--max-entities-per-file <n>', 'maximum entities extracted from one file')
        .option('--max-entities-total <n>', 'maximum cached entities in the run')
        .option('--max-live-entities <n>', 'maximum live lineage heads')
        .option('--max-lineage-events <n>', 'maximum lineage events retained')
        .option('--max-cross-file-candidates <n>', 'maximum candidates on either side of cross-file matching')
        .option('--max-similarity-candidates <n>', 'maximum candidates admitted to similarity matching');
}
/** Resolve a complete bounds object so an invocation records every effective default. */
export function entityBoundsFromCli(options) {
    return {
        maxCommits: parsePositiveInt(options.maxCommits, DEFAULT_ENTITY_BOUNDS.maxCommits, '--max-commits'),
        maxFilesPerCommit: parsePositiveInt(options.maxFilesPerCommit, DEFAULT_ENTITY_BOUNDS.maxFilesPerCommit, '--max-files-per-commit'),
        maxBlobBytes: parsePositiveInt(options.maxBlobBytes, DEFAULT_ENTITY_BOUNDS.maxBlobBytes, '--max-blob-bytes'),
        maxBlobLines: parsePositiveInt(options.maxBlobLines, DEFAULT_ENTITY_BOUNDS.maxBlobLines, '--max-blob-lines'),
        maxTotalBlobBytes: parsePositiveInt(options.maxTotalBlobBytes, DEFAULT_ENTITY_BOUNDS.maxTotalBlobBytes, '--max-total-blob-bytes'),
        maxBatchBytes: parsePositiveInt(options.maxBatchBytes, DEFAULT_ENTITY_BOUNDS.maxBatchBytes, '--max-batch-bytes'),
        maxEntitiesPerFile: parsePositiveInt(options.maxEntitiesPerFile, DEFAULT_ENTITY_BOUNDS.maxEntitiesPerFile, '--max-entities-per-file'),
        maxEntitiesTotal: parsePositiveInt(options.maxEntitiesTotal, DEFAULT_ENTITY_BOUNDS.maxEntitiesTotal, '--max-entities-total'),
        maxLiveEntities: parsePositiveInt(options.maxLiveEntities, DEFAULT_ENTITY_BOUNDS.maxLiveEntities, '--max-live-entities'),
        maxLineageEvents: parsePositiveInt(options.maxLineageEvents, DEFAULT_ENTITY_BOUNDS.maxLineageEvents, '--max-lineage-events'),
        maxCrossFileCandidates: parsePositiveInt(options.maxCrossFileCandidates, DEFAULT_ENTITY_BOUNDS.maxCrossFileCandidates, '--max-cross-file-candidates'),
        maxSimilarityCandidates: parsePositiveInt(options.maxSimilarityCandidates, DEFAULT_ENTITY_BOUNDS.maxSimilarityCandidates, '--max-similarity-candidates'),
    };
}
//# sourceMappingURL=entity-bounds-command.js.map