import { type StackGraph } from "../build.js"; import type { Serializer } from "../serializer.js"; import type { Declarable } from "../declarable.js"; export interface AffectedResult { /** Stacks whose built artifact differs between base and head. */ changed: string[]; /** Downstream consumers of changed stacks (only when `includeDependents`). */ dependents: string[]; /** Stacks with deploy-time inputs — cannot be confirmed from a source diff. */ indeterminate: string[]; } /** Stacks whose serialized output differs between the two builds (added/removed count). */ export declare function changedStacks(base: Map, head: Map): string[]; /** * Walk the cross-stack graph backwards from `changed` to find every stack that * (transitively) consumes a changed stack. Edge `from → to` means `from` * depends on `to`, so a changed `to` makes `from` a dependent. */ export declare function dependentStacks(changed: string[], graph: StackGraph): string[]; /** * Compute the affected set from two per-stack artifact maps and the cross-stack * graph. Pure — no builds, no git — so the model is independently testable. */ export declare function computeAffected(base: Map, head: Map, graph: StackGraph, opts?: { includeDependents?: boolean; externalInput?: string[]; }): AffectedResult; /** A built BuildResult's per-stack (lexicon) primary output, keyed by stack. */ export declare function artifactMap(outputs: Map): Map; /** Stacks (lexicons) that declare a deploy-time parameter — external input. */ export declare function externalInputStacks(entities: Map): string[]; export interface AffectedStacksOptions { /** Project source directory to scope (the head/working-tree build root). */ projectPath: string; serializers: Serializer[]; /** Base git ref to diff against (built in a throwaway worktree). */ baseRef?: string; /** Head git ref. Defaults to the working tree (built in place — no worktree). */ headRef?: string; /** * Caller-supplied base source directory (already on disk). Takes precedence * over `baseRef` — no worktree is created. Use for a build cache or two dist * trees you already have. */ baseDir?: string; includeDependents?: boolean; } /** * Compute the affected stacks for a change. Head is built in place (the working * tree); base is built from `baseDir` if supplied, else from `baseRef` via a * single throwaway worktree. Builds are deterministic, so a cached/supplied base * is as trustworthy as a rebuild. */ export declare function affectedStacks(opts: AffectedStacksOptions): Promise; //# sourceMappingURL=affected.d.ts.map