import type { MergedConfig, PersonaModel } from "../config/config-layer.js"; export interface UiLike { notify(message: string, level?: string): void; } export interface CtxLike { ui: UiLike; } export interface GateFailure { phase: string; reasonCode: string; detail: string; remediation: string; } export interface RunHaltAdvisorOptions { /** Structured failure parsed from preflight-gate.cjs stdout. */ gateFailure: GateFailure; /** Resolved advisor model (from resolveAdvisorModel). If undefined, advisor is skipped. */ advisorModel: PersonaModel | undefined; /** Task or bug id for context. */ taskId: string; /** Working directory. */ cwd: string; /** Extension command context (ui + modelRegistry). */ ctx: CtxLike; /** Optional forge root path — forwarded to runForgeSubagent. */ forgeRoot?: string; } /** * Resolve the advisor model for halt-recovery. * * Priority: * 1. Explicit `advisorModel` config slot from forge-cli layered config. * Contract (rev. 2026-06-04): the advisor model is the HEAVY model the runtime * resolves point-in-time. There is NO dedicated advisorModel config entry — * "heavy" is the approve/architect slot resolved through the existing routing * cascade (L4 phase override → L3/L2 project → L1 user/global → default), * exactly as the approve phase itself would resolve. When the cascade bottoms * out at inherit, the session's current model (pi default) is used. In the * Claude Code plugin route the equivalent is the opus-class session model. * * Returns undefined (advisor skipped, non-fatal) only when nothing is routed * AND no current model is available. * * (History: the original FORGE-S26-T18 implementation used a dedicated * advisorModel config slot with a blind registry fallback that produced * "anthropic/undefined" on the CART-S03-T01 halt — both retired.) */ export declare function resolveAdvisorModel(merged: MergedConfig, currentModel?: { provider?: string; model?: string; id?: string; }, pipelineName?: string): PersonaModel | undefined; /** * Spawn a read-only advisor subagent to explain the gate failure and guide recovery. * * Best-effort: errors are notified via ctx.ui but do NOT propagate. The * primary halt status is the caller's responsibility to surface separately. */ export declare function runHaltAdvisor(opts: RunHaltAdvisorOptions): Promise;