/** * The pure deploy-plan builder: given already-fetched old/new template pairs per * stack and the assembly digest, diff each pair with `@aws-cdk/cloudformation-diff` * and accumulate a typed {@link DeployPlan}. No IO — fixture-testable in full. */ import type { DeployPlan } from "./types.js"; export interface StackTemplatePair { stackName: string; /** The live template; `{}` when the stack does not yet exist (all creations). */ oldTemplate: unknown; /** The freshly synthesised cdk.out template. */ newTemplate: unknown; } /** * Reproduce CloudFormation GetTemplate's ASCII folding on a parsed template. * * WHY: GetTemplate returns stored template bodies with every non-ASCII * character folded to `?` (verified 2026-07-20: em-dashes in alarm * descriptions came back as `?` while the same strings via describe-alarms * were clean UTF-8 — a retrieval artefact). Diffing that folded live body * against the clean local synth made every plan report phantom * encoding-only "changes" that could never converge, padding * resourceChangeCount and resourceChangedStacks with noise. Folding BOTH * operands immediately before `diffTemplate` neutralises the artefact at * that single choke point; template-hash drift detection against recorded * state stays byte-exact. * * Accepted trade-off: a real change that alters ONLY non-ASCII characters * (e.g. swapping one dash variant for another in a description) becomes * invisible to this differ — accepted because such changes are * cosmetic-description class. * * Pure and non-mutating: returns a new structure with string values AND * object keys folded, one `?` per non-ASCII code point (the `[^\x00-\x7F]` * class, applied per character); non-string primitives pass through * untouched. */ export declare function foldTemplateToAscii(value: unknown): unknown; export declare function buildDeployPlan(stacks: StackTemplatePair[], assemblyDigest: string): DeployPlan;