/** * Model tiers (crewly#1173, specs/2026-10-08-model-tiers.md). * * A member may carry a tier (`strong` | `mid` | `weak`) instead of a concrete * model. At launch the tier resolves to a model for the runtime that really * runs: the team's own map (`Team.tierModels`) first, then the global map * (`MODEL_TIER_CONSTANTS.DEFAULT_TIER_MODELS`). A runtime without a `weak` * model uses its `mid` model; any other unmapped tier resolves to nothing * (the runtime's own default). * * @module utils/model-tier */ import type { ModelTier, Team, TeamTierModels, TierChangeMode } from '../types/index.js'; /** Tiers, strongest first. */ export declare const MODEL_TIERS: readonly ModelTier[]; /** * Whether a value names a tier. * * @param value - Candidate * @returns True for `strong`, `mid` or `weak` */ export declare function isModelTier(value: unknown): value is ModelTier; /** * Whether a value names a tier change mode. * * @param value - Candidate * @returns True for `approve` or `auto` */ export declare function isTierChangeMode(value: unknown): value is TierChangeMode; /** * A team's tier change mode (default `approve`). * * @param team - Team * @returns Mode */ export declare function tierChangeModeOf(team: Pick): TierChangeMode; /** * Whether the lead's tier changes apply at once for this team: "Optimize * usage" is on and the owner chose "Lead decides, tells me". * * @param team - Team * @returns True in auto mode */ export declare function leadChangesTiersItself(team: Pick): boolean; /** * Rank of a tier: 2 = strong, 1 = mid, 0 = weak. * * @param tier - Tier * @returns Rank (higher is stronger) */ export declare function tierRank(tier: ModelTier): number; /** * The tier → model map for one runtime: the global map with the team's * overrides on top. Overrides that are not shell-safe model ids are ignored. * * @param runtime - Runtime id (`claude-code`, `codex-cli`, …) * @param overrides - The team's `tierModels` * @returns Map with only the tiers that have a model */ export declare function tierMapFor(runtime: string, overrides?: TeamTierModels): Partial>; /** * The model a tier runs on for a runtime. * * @param runtime - Runtime that launches * @param tier - The member's tier * @param overrides - The team's `tierModels` * @returns Model id, or undefined for the runtime's own default * * @example * ```typescript * resolveTierModel('claude-code', 'weak'); // 'haiku' * resolveTierModel('codex-cli', 'weak'); // 'gpt-5.4' (no weak model: mid) * resolveTierModel('crewly-agent', 'strong'); // undefined * ``` */ export declare function resolveTierModel(runtime: string, tier: ModelTier | undefined, overrides?: TeamTierModels): string | undefined; /** * Validate a team's `tierModels` payload. * * @param value - Candidate (`{ runtime: { tier: model } }`) * @returns The cleaned map, or an error message */ export declare function parseTierModels(value: unknown): { ok: true; value: TeamTierModels; } | { ok: false; error: string; }; //# sourceMappingURL=model-tier.utils.d.ts.map