/** * Profile registry (phase 167, T1) — maps a lowercase file extension to the * `LanguageProfile` that scans it. An appendable map, not a closed switch: * later tasks each add one file (`./python.ts`, `./go.ts`, `./rust.ts`, * `./php.ts`) that calls `registerProfile(...)` for its own built-in * profile, and the per-file dispatch consumer (T6) and doc-content test * (T9) both read from `listProfiles()` / `getProfileForExtension()` — never * duplicate the profile set elsewhere. * * `verification.coverageProfiles` custom-profile merging (T7's addition to * this file, not T1's) is `mergeCustomProfiles` below, called from * `packages/core/src/config/loader.ts`'s `loadConfig` right after a * `.cadence/config.json` passes Zod schema validation — this is what makes * AC-7's "the custom profile is validated at config-load time" literally * true rather than lazily deferred to whenever a scan happens to touch that * extension. Add-only: a custom profile can register any extension no * BUILT-IN profile already owns; claiming a built-in's extension (`.ts`, * `.py`, `.go`, `.rs`, `.php`, ...) is refused loudly, naming the collision * and suggesting a fix (operator decision 2026-07-11 — overriding a * built-in is not supported). `BUILTIN_EXTENSIONS` is snapshotted once, * right after the five built-in `registerProfile` calls below and before * any custom profile can ever be merged, so it only ever reflects genuine * built-ins regardless of how many times `mergeCustomProfiles` itself is * later called (e.g. once per `loadConfig` invocation in a long-running * process) — a custom extension registered by an earlier `mergeCustomProfiles` * call is therefore never mistaken for a built-in on a later call, so * reloading the same config twice in one process re-registers the same * custom profile over itself rather than falsely refusing a "collision" * with its own prior registration. */ import type { LanguageProfile } from './types.js'; import type { CoverageProfileConfig } from '@manehorizons/cadence-types'; import { jsTsProfile } from './js-ts.js'; import { pythonProfile } from './python.js'; import { goProfile } from './go.js'; import { rustProfile } from './rust.js'; import { phpProfile } from './php.js'; /** Register a profile for all of its declared extensions. */ export declare function registerProfile(profile: LanguageProfile): void; /** Look up the profile claiming a given extension (`'.ts'` or `'ts'`). */ export declare function getProfileForExtension(ext: string): LanguageProfile | undefined; /** All distinct registered profiles (built-in + any custom-merged later). */ export declare function listProfiles(): LanguageProfile[]; /** * Compiles and registers every entry of `verification.coverageProfiles` * (phase 167, T7, AC-7). Atomic per call: every entry is compiled * (`compileCustomProfile`, `./custom.js`) and checked for an extension * collision — against a built-in, and against an earlier entry in this same * `raws` array — BEFORE any of them are registered, so a bad entry later in * the list never leaves an earlier, valid entry from the same call * half-registered (refuse + suggest applies to the whole batch, not a * silently-partial one). Called from `loadConfig` * (`packages/core/src/config/loader.ts`) with the Zod-parsed * `verification.coverageProfiles` array — an empty array (the default) is a * no-op. */ export declare function mergeCustomProfiles(raws: CoverageProfileConfig[]): void; export { jsTsProfile, pythonProfile, goProfile, rustProfile, phpProfile }; //# sourceMappingURL=registry.d.ts.map