import { type LexiconPlugin } from "../lexicon.js"; /** * Load a single lexicon plugin by lexicon name. * * Dynamically imports `@intentius/chant-lexicon-{name}` and looks for a * LexiconPlugin export. Falls back to wrapping a raw Serializer export. */ export declare function loadPlugin(lexiconName: string): Promise; /** * The installed version of each named lexicon package (chant #1442). * * A `LexiconPlugin` does not carry its own version — `LexiconManifest` does, * but that is an artifact type describing generated output, not something the * plugin object exposes. The version wanted here is a property of the * *installed package*, so it is read from the package's own `package.json`. * * Resolved by walking up from the package's entry point rather than resolving * `/package.json` directly: lexicon packages declare an `exports` map * that does not include `./package.json`, so the direct specifier is blocked * by Node. `./manifest` (→ `dist/manifest.json`) is not used either — it is a * `prepack` build artifact, absent in a monorepo dev tree, and its absence * once read as four unrelated bugs (#1367). * * A lexicon whose version cannot be determined is omitted rather than * recorded as `"unknown"`: a digest that says nothing is honest, one that * says `unknown` compares unequal to itself across builds. */ export declare function resolveLexiconVersions(lexiconNames: readonly string[]): Record; /** * Bind each loaded plugin's `buildRoots` hook (#1548 piece 3) to this * invocation's config and project root, producing the closures * `BuildOptions.buildRoots` takes — the same extract-then-thread shape the * CLI uses for `intrinsics`. Plugins without the hook contribute nothing; * an empty array is the common case and `build()` treats it as absent. */ export declare function collectBuildRootContributors(plugins: readonly LexiconPlugin[] | undefined, config: Record, projectRoot: string): Array<() => Promise>; /** * Load plugins for all detected lexicon names. * Calls `init()` on each plugin if present. */ export declare function loadPlugins(lexiconNames: string[]): Promise; /** * Resolve lexicon names for a project directory. * * Reads `lexicons` from `chant.config.ts` / `chant.config.json` if present. * Falls back to source-file detection via `detectLexicons()`. * * chant #1045 Phase 2 — this used to fall back to a full `discover()` call * just to read its `sourceFiles` list, which imports and RUNS every project * source file to collect entities that are then discarded here. That ran * unconditionally, on every command that reaches this function without an * explicit `chant.config.ts` `lexicons` list (`build`, `lint`, `doctor`, * `import`, `graph`, the MCP server — effectively the whole CLI), with no * `--fold`/`--sandbox` involved at all: a project could omit `lexicons` and * every file would execute here, in the CLI's own process, before the * caller's OWN (possibly folded, possibly sandboxed) build ever ran. Fixed * by using `findInfraFiles()` alone — the pure directory walk `discover()` * itself starts from, no import, no execution — since `detectLexicons()` is * already a plain text/regex scan over file contents (`../detectLexicon.ts`) * that never needed live module exports to begin with. This is strictly * better than routing the detection through the sandbox: it removes the * execution entirely rather than containing it, at no bundling/spawn cost. * * chant #1117 — walks up from `projectPath` to the project root * (`loadChantConfigUpward`) rather than reading `projectPath` alone: `chant * build src/` calls this with the stack's own subdirectory, and a * project that declares `lexicons` only in its root `chant.config.ts` (never * detectable by `detectLexicons()`'s import scan alone, e.g. a lexicon that's * loaded but never imported by name in that particular stack's files) would * otherwise silently miss it. */ export declare function resolveProjectLexicons(projectPath: string): Promise; //# sourceMappingURL=plugins.d.ts.map