import { type ResourceKind, type ResourceNode } from "../core.js"; import type { ChangeType, CompileResult, State, ValidationError } from "./compile.js"; import type { LoadError } from "./load.js"; /** * The diff, then anything that failed to validate. * * Both, deliberately: "mostly working, one file broken" is the normal state * while authoring, and returning early on the errors hid every resource that * loaded fine — which is precisely when you most want to see them. The command * still exits non-zero, so this changes what you read, not what CI decides. */ export declare function formatPlan(result: CompileResult): string; /** * Human-readable formatting of a `check` result — every load-time failure * (body / slug / transpile errors, grouped by file) followed by every graph * validation error (unknown tokens, cycles), so all violations surface in a * single pass. Pure (data in / string out) so it is unit-testable. */ export declare function formatCheck(result: { loadErrors: LoadError[]; compile: CompileResult; }): string; /** One resource row in an `info` report. */ export type InfoResource = { id: string; kind: ResourceKind; slug: string; /** The file that declared it — undefined for a resource only found in state. */ file: string | undefined; change: ChangeType; uuid: string | undefined; releaseStatus: "draft" | undefined; deps: string[]; }; /** * The project an `info` report is about. Both CDK versions are reported because * a project whose installed `@cargo-ai/cdk` is older than the one running the * command fails at import time with an opaque missing-export error — seeing the * two side by side is what makes that diagnosable. */ export type InfoProject = { name: string; path: string; cdkRunning: string; cdkInstalled: string | undefined; }; /** Everything `cdk info` knows about a project, before it is rendered. */ export type InfoReport = { project: InfoProject; state: { present: boolean; workspaceUuid: string | undefined; tracked: number; }; declared: InfoResource[]; orphans: InfoResource[]; loadErrors: LoadError[]; validationErrors: ValidationError[]; }; /** * Fold a `check` pass, the committed state and the project's identity into the * rows `info` prints. Pure, so the mapping that actually carries meaning — which * resource is new, which is an unpublished draft, which lingers in state with no * code left to describe it — is unit-testable without a repo on disk. */ export declare function buildInfoReport(input: { project: InfoProject; state: State | undefined; check: { loadErrors: LoadError[]; compile: CompileResult; nodes: ResourceNode[]; files: Record; }; }): InfoReport; /** * Terminal styling, injected rather than imported so this stays pure and its * tests keep asserting on plain strings. The CLI passes a palette gated on * stdout — where `info` prints — and everything else gets {@link PLAIN}. */ export type Palette = { bold: (text: string) => string; cyan: (text: string) => string; dim: (text: string) => string; green: (text: string) => string; red: (text: string) => string; yellow: (text: string) => string; }; /** * Human-readable formatting of an `InfoReport` — the whole resolved project on * one screen. Pure (data in / string out) so it is unit-testable. * * Two lines of header, then one line per resource in dependency order, so a * resource always appears below the ones it depends on and the `←` column can * be checked by eye. Columns that carry nothing are dropped rather than padded: * a project that has never been deployed has no uuids to show. */ export declare function formatInfo(report: InfoReport, palette?: Palette): string; //# sourceMappingURL=plan.d.ts.map