import type { ConfigLayer } from "../../config/config-writer.js"; import { type Tier } from "../tier-meta.js"; import type { ConfigTuiState, PersonaPickerEntry, PhaseOverride, PipelineOverrideSummary, ResolvedPersonaEntry, TierAssignment, View } from "./model.js"; export declare function getActiveView(state: ConfigTuiState): View; export declare function listResolvedPersonas(state: ConfigTuiState): ResolvedPersonaEntry[]; export declare function listPersonaPickerEntries(state: ConfigTuiState): PersonaPickerEntry[]; export declare function uniqueProviders(state: ConfigTuiState): string[]; export declare function listPipelineOverrideSummaries(state: ConfigTuiState): PipelineOverrideSummary[]; export declare function getPhaseOverride(state: ConfigTuiState, pipeline: string, phaseRole: string): PhaseOverride | undefined; import { type ResolveSource } from "../../config/model-resolver.js"; /** A row in the phase table (Screen 3 — "Show what runs at each step"). */ export interface PhaseTableRow { /** Phase role (e.g. "plan", "review-plan"). */ role: string; /** Persona name (e.g. "engineer"). */ persona: string; /** Persona emoji (e.g. "🌱"). */ personaEmoji: string; /** Persona tier ("heavy" | "standard" | "light"). */ tier: Tier; /** Resolved model string ("provider:model") or "(inherit pi current)". */ resolved: string; /** Raw model resolver source ("L1", "L2", "L4-inline", etc.). */ rawSource: ResolveSource; /** Human-readable source label (e.g. "Standard tier (global)"). */ sourceLabel: string; } /** Map a model-resolver source + persona tier + resolved-layer to a * human-readable source label per the plan's cascade vocabulary. * * | Internal | Plain English | * |-----------|---------------| * | L4-inline / L4-name | "Step override" | * | L3 | "Per-persona override (pipeline)" | * | L2 | "{Tier} tier (project)" | * | L1 | "{Tier} tier (global)" | * | default | "Default fallback" | * | inherit | "Falls back to pi current" | */ export declare function sourceToLabel(rawSource: ResolveSource, tier: Tier | undefined, isProject: boolean): string; /** Build the phase table for Screen 3. * Joins PHASE_PERSONA_TABLE with model resolution results. */ export declare function getPhaseTable(state: ConfigTuiState): PhaseTableRow[]; /** Determine the effective model for an entire tier. * Returns "set" when all personas in the tier resolve to the same model, * "mixed" when some are missing or they diverge, "unset" when none are resolved. */ export declare function getTierAssignment(state: ConfigTuiState, tier: Tier): TierAssignment; /** Return all three tier assignments as an array (stable order: heavy, standard, light). */ export declare function getAllTierAssignments(state: ConfigTuiState): Array<{ tier: Tier; assignment: TierAssignment; }>; /** Scope-aware tier assignment: returns what's set at the given scope layer. * When scope is "global", shows global-layer assignments only. * When scope is "project", shows the resolved (merged) view since project * layer is where overrides live on top of global. * If a tier has no assignment at the active scope layer but has one at * the other layer, shows { status: "set-in-other-layer" } with the details. */ export type ScopedTierAssignment = { status: "set"; provider: string; model: string; layer: ConfigLayer; } | { status: "set-in-other-layer"; provider: string; model: string; otherLayer: ConfigLayer; } | { status: "mixed"; } | { status: "unset"; }; export declare function getScopedTierAssignment(state: ConfigTuiState, tier: Tier, scope: ConfigLayer): ScopedTierAssignment; export declare function getAllScopedTierAssignments(state: ConfigTuiState, scope: ConfigLayer): Array<{ tier: Tier; assignment: ScopedTierAssignment; }>; /** Which tier does a persona belong to? Returns undefined for unknown names. */ export declare function getTierForPersona(persona: string): Tier | undefined; /** Persona names in a tier. */ export declare function getPersonasInTier(tier: Tier): readonly string[]; /** True when neither global nor project config has any persona-model assignments. * Replaces the old `state.isEmpty` snapshot — this is derived from buffer, * so it stays correct after mutations. */ export declare function isConfigEmpty(state: ConfigTuiState): boolean; /** Human-readable source label for a persona-model assignment. * Replaces the old raw L1/L2/default-L1/default-L2 display. * Uses tier labels when the persona has a known tier, otherwise falls back * to generic "global"/"project" labels. */ export declare function personaSourceLabel(persona: string, source: "L1" | "L2"): string;