import type { Serializer } from "../../serializer.js"; import type { LexiconPlugin } from "../../lexicon.js"; /** * Build command options */ export interface BuildOptions { /** Path to infrastructure directory */ path: string; /** Output file path (undefined = stdout) */ output?: string; /** Output format */ format: "json" | "yaml"; /** Serializers to use for serialization */ serializers: Serializer[]; /** Lexicon plugins (for post-synth checks) */ plugins?: LexiconPlugin[]; /** Print summary to stderr */ verbose?: boolean; /** * Environment/stack to evaluate policy against (`--env`). Falls back to the * project's `ownership.env`. Passed into post-synth checks so organizational * policy can branch on environment. */ env?: string; /** * chant #1022/#1134 (epic #1019) — fold source modules statically instead * of importing/running them; the DEFAULT build path since #1134. Falls * back to run per-file for anything the folder can't represent. Tri-state: * `--fold` → true, `--no-fold` → false, unset → the project config / * default via {@link resolveFoldEnabled}. An explicit flag always wins for * the invocation, in either direction. */ fold?: boolean; /** * chant #1045 Phase 2 — opt-in: run-fallback source files (or, without * `fold`, every file) execute together, isolated, in one sandboxed child * process (`chant build --sandbox`). Merged with the project's * `chant.config.ts` `build.sandbox` via {@link resolveSandboxEnabled} — * this flag, when true, always wins for the invocation. */ sandbox?: boolean; /** * chant #1064 — `--param name=value` flags (repeatable), parsed to a flat * `{ name: value }` record of raw (unvalidated) strings. Highest * precedence in {@link resolveBuildParams}'s resolution against the * project's declared `chant.config.ts` `buildParams`. */ params?: Record; /** * chant #1064 — `--params-file `: a JSON file of `{ "name": value }` * build-time parameter values, read and parsed here. Second precedence, * after {@link params}. */ paramsFile?: string; } /** * Resolve the output format for `chant build`. * * When `--format` is not given, infer it from the `-o` file extension * (`.yaml`/`.yml` → yaml, `.json` → json); fall back to json when there is no * extension to infer from. An explicit `--format` always wins, but a mismatch * with the output extension is surfaced as a warning. */ export declare function resolveBuildFormat(explicit: string | undefined, output: string | undefined): { format: "json" | "yaml"; warning?: string; }; /** * Build command result */ export interface BuildResult { /** Whether the build succeeded */ success: boolean; /** Number of resources built */ resourceCount: number; /** Number of source files processed */ fileCount: number; /** Error messages */ errors: string[]; /** Warning messages */ warnings: string[]; /** This build's resolved build-time parameters (#1064) — see `BuildResult.buildParams` (../../build.ts). Empty when the project declares/supplies none. */ buildParams?: import("../../provenance.js").BuildParamProvenance[]; } /** * Execute the build command */ export declare function buildCommand(options: BuildOptions): Promise; /** * `fold: 8 files folded, 13 ran (--verbose for reasons)` — the non-verbose * report of a fold build's per-file decisions (#1424). The "(--verbose for * reasons)" hint appears only when something ran, since that is the only case * with a reason to read. */ export declare function summarizeFoldDecisions(decisions: readonly { mode: string; }[]): string; /** * Print errors to stderr */ export declare function printErrors(errors: string[]): void; /** * Print warnings to stderr */ export declare function printWarnings(warnings: string[]): void; /** * Run build in watch mode. Runs an initial build, then watches for changes * and triggers rebuilds. Returns a cleanup function. */ export declare function buildCommandWatch(options: BuildOptions, onRebuild?: (result: BuildResult) => void): () => void; //# sourceMappingURL=build.d.ts.map