/** * Shared walking/wiring helpers for the COMP* composition rules (#562, epic * #551). Every COMP rule operates over the real, discovered `Component` * graph (see ../../component-checks.ts), not raw TypeScript source — these * helpers flatten a component's `deploy`/`rollback` phases into steps and * parse the wiring reference forms `../../../components/driver.ts` already * resolves at runtime, so lint can check the same references before * anything runs (per docs/components/orchestration.mdx). */ import type { Component, Gate, Phase, Step } from "../../../components/component.js"; /** True if a step/gate/nested-phase entry is a `Gate` (`kind: "gate"`). */ export declare function isGateEntry(entry: Step | Gate | Phase): entry is Gate; /** True if a step/gate/nested-phase entry is itself a nested `Phase` (a fan-out unit) — see `component.ts`'s `isNestedPhase`. */ export declare function isPhaseEntry(entry: Step | Gate | Phase): entry is Phase; /** True if a step/gate/nested-phase entry is a plain capability `Step` (neither a gate nor a nested phase). */ export declare function isStepEntry(entry: Step | Gate | Phase): entry is Step; /** One step found while walking a component, together with the (possibly nested) phase it lives directly under. */ export interface WalkedStep { step: Step; phaseName: string; /** * The exact `Phase` object this step lives directly under — object * identity, not just `phaseName`, since two different nested fan-out * phases (or a nested phase and its parent) can share the same display * name. Rules that need "another step in this same phase" (e.g. COMP003's * compensation-sibling check) should group by this reference, not by name. */ phase: Phase; } /** One gate found while walking a component, together with the phase it lives directly under. */ export interface WalkedGate { gate: Gate; phaseName: string; phase: Phase; } /** * Flatten every step and gate across a list of phases (including nested * fan-out phases and `onFailure` compensation phases), matching * `component.ts`'s own `allSteps` walk but keeping the immediate phase * alongside each entry (needed for `@Phase.field` reference checks and for * "same phase" sibling checks) and separating gates out explicitly. */ export declare function walkPhases(phases: Phase[] | undefined): { steps: WalkedStep[]; gates: WalkedGate[]; }; /** Every step and gate across a component's `deploy` plus its top-level `rollback` phases. */ export declare function walkComponent(component: Component): { steps: WalkedStep[]; gates: WalkedGate[]; }; /** Every distinct phase name declared directly in a component's `deploy` (top-level only, not nested fan-out phase names — those are addressed by the fan-out's own phase name, never the parent's). */ export declare function topLevelPhaseNames(component: Component): Set; export interface PriorStepRef { kind: "prior-step"; phaseName: string; field: string; } export interface ComponentArtifactRef { kind: "component-artifact"; componentName: string; field: "uri" | "digest" | "key"; } export type WiringRef = PriorStepRef | ComponentArtifactRef; /** Parse a single string value as one of the two name-bearing wiring reference forms (`@Phase.field`, `@component.publish.*`). Returns `undefined` for a plain literal, an `$env.*` reference, or a malformed `@` reference (schema validation, not lint, is responsible for rejecting malformed references). */ export declare function parseWiringRef(value: unknown): WiringRef | undefined; /** Recursively collect every wiring-reference-shaped string found anywhere in a step's fields (imageRef, jar, revision, inputs, and any other open capability-specific property), matching how ../../../components/driver.ts's `resolveStepInput` walks a step's input. */ export declare function collectWiringRefs(step: Step): WiringRef[]; /** A structural fingerprint of a component's composition shape, ignoring `name`/`dependsOn`/wiring literal values — two components with the same fingerprint compose the exact same phase/step-kind shape (see COMP007, "identical composition repeated across components"). */ export declare function compositionFingerprint(component: Component): string; //# sourceMappingURL=support.d.ts.map