/** * Pure policy for which app ports to expose. * * Keeps boot/resume/empty/conflict/capacity rules out of the I/O orchestrator * so those rules can grow without nesting another ladder inside scan/prompt/ * update code. */ import { type AppPortCandidate } from './app-ports.js'; export type AppPortSelectionDecision = { kind: 'selected'; selected: number[]; notice?: string; } | { kind: 'prompt'; } | { kind: 'non-interactive'; selected: number[]; notice: string; }; export interface DecideAppPortSelectionInput { branch: string; exposePorts?: readonly number[]; reusable: boolean; previousSelected: readonly number[]; candidates: readonly AppPortCandidate[]; configured: readonly number[]; tty: boolean; } /** Room left for app ports once the configured set and reserved noVNC are in. */ export declare function remainingAppPortCapacity(configured: readonly number[]): number; export declare function candidatePortsOf(candidates: readonly AppPortCandidate[]): number[]; export declare function candidatesFitCapacity(configured: readonly number[], candidates: readonly AppPortCandidate[]): boolean; export declare function decideAppPortSelection(input: DecideAppPortSelectionInput): AppPortSelectionDecision;