/** * Declarative language-support registry (change: add-declarative-language-support-registry). * * Consolidates the per-language capability knowledge OpenLore already encodes — scattered * across the call-graph extractor, the CFG `SPECS` table, the signature extractor, the * type-inference engine, and the IaC projector — behind one declarative, queryable * registry, and makes per-language coverage an observable fact. * * Faithfulness is the whole point: an over-claimed coverage matrix is worse than none. So * this registry is DERIVED, not hand-listed — each capability flag is computed from the * SAME authoritative structure the corresponding extractor consults at run time: * - `signatures` ← {@link SIGNATURE_LANGUAGES} (signature-extractor.ts) * - `callGraph` ← {@link CALLGRAPH_LANGUAGES} (call-graph.ts) * - `imports` ← {@link IMPORT_RESOLUTION_LANGUAGES} (import-resolver-bridge.ts) * - `cfgOverlay` ← {@link cfgSupportsLanguage} (cfg.ts) * - `typeInference` ← {@link TYPE_INFERENCE_LANGUAGES} (type-inference-engine.ts) * - `iacProjection` ← {@link isIacLanguage} (iac/types.ts) * - `styleFingerprint`← {@link STYLE_FINGERPRINT_LANGUAGES} (style-fingerprint.ts) * A behavioral test (`language-support.test.ts`) cross-checks each flag against the live * extractor on a fixture, so the registry cannot silently drift from reality. * * Fail-soft is a uniform contract: a language with no record — or a record that does not * back a capability — yields nothing for that capability, never an error or a guess. This * change does NOT alter extraction output for any language; it only organizes and exposes * support that already exists. * * Deterministic, no LLM, no graph-schema change. */ /** The closed set of capabilities the registry tracks, in deterministic column order. */ export declare const CAPABILITIES: readonly ["signatures", "callGraph", "imports", "cfgOverlay", "typeInference", "styleFingerprint", "iacProjection", "crossServiceHttp", "errorPropagation"]; export type Capability = (typeof CAPABILITIES)[number]; /** Human-readable, agent-facing description of what each capability means. */ export declare const CAPABILITY_DESCRIPTIONS: Record; /** * General-purpose code languages — `detectLanguage`'s outputs excluding the `unknown` * fallback. (Terraform and Bicep are extension-detected too, so they live here.) A * completeness test asserts `detectLanguage` maps a representative extension to each. */ export declare const CODE_LANGUAGES: readonly string[]; /** * IaC ecosystem tags a node can carry that are NOT extension-detected code languages — * derived from the IaC projector's authoritative {@link IAC_LANGUAGES} so it can't drift. * These include Pulumi/CDK/CDKTF: although they ride on general-purpose host files, the * IaC projector tags the resource nodes it derives with the ecosystem name, so a node CAN * have these languages (confirmed by dogfooding) and the registry must represent them * (their only backed capability is `iacProjection`). */ export declare const IAC_TAG_LANGUAGES: readonly string[]; /** Every language a node can be tagged with — the registry's complete key universe (sorted). */ export declare const ALL_LANGUAGES: readonly string[]; export { detectLanguage, EXTENSION_TO_LANGUAGE } from './language-detection.js'; /** One language's declarative support record: the capabilities it backs. */ export interface LanguageSupportRecord { language: string; /** Supported capabilities, in {@link CAPABILITIES} order. */ capabilities: Capability[]; /** Whether the language is even a known registry key (false → fail-soft "nothing claimed"). */ known: boolean; } /** * The declarative registry: language → its derived support record, for every known * language. Computed once from the authoritative capability sources — never hand-listed, * so it cannot drift from what the extractors actually do. */ export declare const LANGUAGE_SUPPORT: ReadonlyMap; /** * The support record for a language, fail-soft: an unknown language (no record) yields a * record with NO capabilities and `known: false` — never an error, never a guess. This is * the uniform fail-soft contract: ask about Haskell and you get an honest "nothing * claimed", not a crash and not a fabricated capability. */ export declare function languageSupport(language: string): LanguageSupportRecord; /** * Resolve a free-form language string to its canonical registry name, case-insensitively * and trimming surrounding whitespace (so `"go"`, `"GO"`, `" Go "` all resolve to `"Go"`). * Returns `null` when no known language matches — the caller decides the fail-soft response. * This keeps the named-language lookup from being a casing foot-gun for agents while still * being honest about genuinely-unknown languages. */ export declare function resolveLanguageName(input: string): string | null; /** A single cell-resolved coverage matrix: deterministic language × capability booleans. */ export interface CoverageMatrix { /** Column order (== {@link CAPABILITIES}). */ capabilities: Capability[]; rows: Array<{ language: string; known: boolean; /** capability → supported, for every capability in `capabilities`. */ supported: Record; supportedCount: number; }>; } /** * The coverage matrix (language × capability). With NO argument (`undefined`), every known * language; with a language list (e.g. a repo's detected languages), exactly those — an * unknown language yields an all-`false` row (fail-soft, labeled `known: false`). An EMPTY * list (`[]`) yields NO rows — distinct from `undefined`, so a repo with zero detected * languages does not silently expand to the whole registry (that bug let a docs-only repo * report every language as present). Deterministic: languages are sorted and capabilities * are in fixed order, so two derivations are byte-identical. */ export declare function languageCoverageMatrix(languages?: readonly string[]): CoverageMatrix; /** Render the coverage matrix as a deterministic Markdown table (for the analysis digest). */ export declare function renderCoverageMatrixMarkdown(matrix: CoverageMatrix): string[]; //# sourceMappingURL=language-support.d.ts.map