import type { ExtractedEntityEvidenceV2 } from './syntax-evidence.js';
import type { CodeFileGuardrails } from '../parsers.js';
import type { ParsedFile, ParsedSymbol } from '../types.js';
import type { BlobEntities, EntityBounds, EntityCounters, EntityRecord } from './types.js';
/**
 * Contract shared by immutable blob structure and the historical entity index.
 *
 * The OCC package version is deliberately not part of this identity: evidence
 * produced by another OCC release composes when both releases used the same
 * declaration parser contract.
 */
export interface EntityParserContract {
    parserName: string;
    parserVersion: number;
}
export declare const ENTITY_PARSER_CONTRACT: Readonly<{
    parserName: "occ.code.parsers";
    parserVersion: 4;
}>;
export declare const ENTITY_PARSER_CONTRACT_ID: "occ.code.parsers@4";
export declare function looksBinary(buffer: Buffer): boolean;
export interface ExtractEntitiesInput {
    repoRoot: string;
    relativePath: string;
    blobSha: string;
    content: string;
    byteLength: number;
    guardrails?: CodeFileGuardrails;
    bounds?: Pick<EntityBounds, 'maxEntitiesPerFile'>;
    counters?: EntityCounters;
    /** Extract data-format entities. Default true. */
    formats?: boolean;
}
/**
 * Turn one blob's text into entity records.
 *
 * Pure with respect to git and to the working tree: everything it needs
 * arrives as arguments, which is what makes the result cacheable by blob id.
 * Import resolution is disabled because it would consult today's filesystem
 * for a historical revision, and nothing about entity identity reads it.
 */
export declare function extractEntitiesFromBlob(input: ExtractEntitiesInput): Promise<BlobEntities>;
export interface EntityExtraction {
    records: EntityRecord[];
    /**
     * The symbol each record came from, positionally aligned with `records`.
     *
     * `EntityRecord` deliberately carries no `nodeId`: it is cached by blob id and
     * must describe content alone, while a node id belongs to one particular
     * index of one particular working tree. Callers that need the bridge from an
     * entity to the code graph take it from here.
     */
    symbols: ParsedSymbol[];
    truncated: boolean;
    /** Supported format text was malformed; false for code extraction. */
    parseFailed: boolean;
}
export declare function entitiesFromParsedFile(file: ParsedFile, relativePath: string, maxEntities?: number, evidence?: ReadonlyMap<ParsedSymbol, ExtractedEntityEvidenceV2>): EntityExtraction;
/** Index a snapshot's entities by the file they live in. */
export declare function groupByPath(entities: readonly EntityRecord[]): Map<string, EntityRecord[]>;
/** Stable key for an entity's position in a file, used by the exact-identity rung. */
export declare function entityStateKey(entity: Pick<EntityRecord, 'relativePath' | 'kind' | 'qualifiedName' | 'ordinal'>): string;
/**
 * Turn one data-format document into entity records.
 *
 * The same hash machinery as code: a format entity's span is text like any
 * other. `normalizedHash` and `structuralHash` remain identity heuristics, so
 * a renamed JSON key can be paired without either hash making a semantic
 * no-op claim.
 */
export declare function entitiesFromFormat(content: string, relativePath: string, maxEntities?: number, enabled?: boolean): EntityExtraction;
