/** * Env teardown for the fly lexicon (chant #1222) — both halves of the * `teardownOwned` / `executeTeardown` capability pair, over the applier's own * flaps primitives (op/activities/fly-apply.ts). * * Selection follows the two-tier ownership convention (#743, D2): * * - Machines carry the primary marker in `config.metadata` * (`managed-by: chant` + `chant-stack` + `chant-env`), so a machine is a * candidate exactly when its own metadata reads back the requested * stack + env identity. * - The app is the boundary for everything metadata-less (volumes, IPs, * certificates, secrets). An app becomes a candidate only when it has at * least one machine and EVERY machine in it carries the requested * identity — an app also hosting a foreign or other-env machine is never * deleted whole; only its matching machines are. * * Enumeration lists apps via `GET /v1/apps` (mudflaps serves it as-is; real * flaps wants `?org_slug=`, appended from FLY_ORG / FLY_ORG_SLUG when set) * and each app's machines. An unlistable app is a hole (#1089) — unknown, * never absent. * * Execution deletes machines first (lease → destroy → wait, the applier's * `destroyMachine`) and apps last (`deleteApp`, which takes the app-scoped * volumes/IPs/certs with it). Before every delete the live side is re-read * and the identity re-verified; already-gone is `deleted` (teardown is * idempotent), an identity mismatch is `not-prunable`, never a delete. */ import type { TeardownCandidate, TeardownEnumeration, TeardownExecution } from "@intentius/chant/lexicon"; import { type OwnershipMarker } from "@intentius/chant/ownership"; import { type FlyHttp, type WaitOpts } from "./op/activities/fly-apply.js"; export interface FlyTeardownOptions { environment: string; marker: OwnershipMarker; } /** Injection seam for tests: scripted http, explicit endpoint, shrunk waits. */ export interface FlyTeardownDeps { http?: FlyHttp; endpoint?: string; wait?: WaitOpts; } /** * Enumerate the env's marker-matching machines and whole-app boundaries — the * fly half of `chant lifecycle teardown ` planning. */ export declare function teardownOwned(options: FlyTeardownOptions, deps?: FlyTeardownDeps): Promise; /** * Delete the handed-over candidates: machines first, apps last. One outcome * per candidate, always. */ export declare function executeTeardown(options: FlyTeardownOptions & { candidates: TeardownCandidate[]; }, deps?: FlyTeardownDeps): Promise; //# sourceMappingURL=teardown.d.ts.map