/**
 * Shortest name that may be added at runtime.
 *
 * A three-character entry matches an initialism somewhere in almost any
 * repository. Refusing it is the difference between a list with no
 * false-positive problem and a list that reintroduces the one the shape guard
 * was written to avoid.
 */
export declare const MIN_NAME_LENGTH = 5;
/**
 * Strip a name to the form the digests are taken over.
 *
 * Case and separators are spelling, not identity: `Some-Host`, `some host` and
 * `SomeHost` are one name.
 * @param raw - A name or a candidate span of source text.
 * @returns Lowercased, alphanumerics only.
 */
export declare function normalizeName(raw: string): string;
/**
 * The stored form of one name: its normalized length, then its digest.
 *
 * The length is carried in the clear on purpose. It is what lets a scan reject
 * the overwhelming majority of candidate spellings with an integer comparison
 * instead of a hash, and knowing that some name is eight characters long
 * identifies nobody.
 * @param raw - The name to encode.
 * @returns `"<length>:<digest>"`.
 */
export declare function nameEntry(raw: string): string;
/**
 * Host org and company names, as entries.
 *
 * Org and company slugs only. The two other identity shapes this repository
 * carries — host repository names and a host tracker's project-key prefix — are
 * deliberately absent; arming them is a several-hundred-file rewrite and an
 * owner decision, not a cleanup. See
 * `.agents/rules/never-name-downstream-projects.md` for how to add one.
 *
 * Sorted, so the order of this array says nothing about the order the names
 * were added or how they relate to each other.
 */
export declare const HOST_NAME_ENTRIES: readonly string[];
/** Environment variable carrying extra names, comma-separated, in plaintext. */
export declare const NAME_ENV_VAR = "LISA_DOWNSTREAM_NAMES";
/**
 * Everything a scan needs to test a candidate span, prepared once.
 *
 * `lengths` is not a convenience: deriving it per line would cost more than the
 * matching does, and it is the filter that lets almost every candidate be
 * rejected on an integer comparison instead of a hash.
 */
export interface NameMatcher {
    /** `"<length>:<digest>"` for every known name. */
    readonly entries: ReadonlySet<string>;
    /** Every normalized length present in {@link entries}. */
    readonly lengths: ReadonlySet<number>;
    /** The longest normalized length present, used to stop widening a window. */
    readonly maxLength: number;
}
/**
 * The matcher a scan should use: the committed entries plus any supplied by
 * the environment.
 *
 * Environment names shorter than {@link MIN_NAME_LENGTH} are dropped rather
 * than rejected loudly — a scan is not the place to fail a run over a malformed
 * environment variable, and a silently-ignored short name is visible the moment
 * anyone checks whether the guard bites.
 * @param env - Environment to read; defaults to the process environment.
 * @returns A prepared matcher.
 */
export declare function hostNameEntries(env?: NodeJS.ProcessEnv): NameMatcher;
/**
 * Every span of one line that spells a known host name.
 *
 * Matching is anchored to word boundaries at both ends, which is what keeps a
 * name from firing inside a longer word: an entry for `somehost` does not match
 * `somehosting`.
 * @param text - The line to scan.
 * @param matcher - Prepared matcher from {@link hostNameEntries}.
 * @returns The matched source spans, in order.
 */
export declare function findHostNames(text: string, matcher: NameMatcher): readonly string[];
//# sourceMappingURL=downstream-names.d.ts.map