/** * `chant carve emit` — the first strangler-fig emit step (#197). * * Given a resource selected from a Terraform estate, it: * 1. classifies the boundary (which edges the carve cuts), * 2. adopts the live resource into typed chant source via live import * (`chant import --from ` machinery — cloud→code, read-only export), * 3. writes a boundary report. * * It does not patch the surviving Terraform or apply anything — that is the * boundary-bridging and apply-graduation work (later PRs). This lands the * resource at the observe position: emitted, reversible, nothing mutated. */ import { type CarveReport } from "../../terraform/carve.js"; import { type DeferredParam, type FoldedContribution } from "../../terraform/adopt-state.js"; import type { LexiconPlugin, ResourceSelector } from "../../lexicon.js"; import type { ImportResult, LiveImportOptions } from "./import.js"; export interface CarveEmitOptions { /** Terraform estate directory (`--from`). */ from?: string; /** Terraform address to carve, e.g. `aws_s3_bucket.assets` (`--select`). */ select?: string; /** Live environment to adopt from (`--env`). */ env?: string; /** * CloudFormation logical ID to adopt on the live path (`--live-name`). The * live import filters a stack's template by logical ID, which is not the * Terraform physical name — so the live selector is by native type by * default, and this narrows it when a stack has several of that type. */ liveName?: string; /** Opt-in `.tfstate` for instance counts (`--state`). */ statePath?: string; /** Output directory for the emitted source (`--output`). */ output?: string; /** Write the boundary report JSON here (`--report`). */ reportFile?: string; } /** Injected so tests exercise emit without cloud calls. */ export interface CarveEmitDeps { plugins: LexiconPlugin[]; liveImport: (plugins: LexiconPlugin[], options: LiveImportOptions) => Promise; } export interface CarveEmitResult { ok: boolean; error?: string; report?: CarveReport; emit?: ImportResult; /** The selector used for the live adoption, for transparency (cloud path). */ selector?: ResourceSelector; /** How the resource was adopted. */ source?: "tfstate" | "live"; /** Emitted file path(s). */ emittedFiles?: string[]; /** Project files scaffolded around the emitted source (config, package.json). */ scaffolded?: string[]; /** Deferred outbound inputs declared as build parameters in the emitted project (#998). */ params?: DeferredParam[]; /** Folded sub-resources and the props each joined into the emitted parent (#1637). */ folded?: FoldedContribution[]; /** The persisted carve state manifest bridge/apply compose with. */ manifestPath?: string; } export declare function carveEmit(opts: CarveEmitOptions, deps: CarveEmitDeps): Promise; /** Human-readable emit summary: what was adopted and what boundary work remains. */ export declare function formatCarveEmit(result: CarveEmitResult): string; //# sourceMappingURL=carve-emit.d.ts.map