import type { LanguageModel } from 'ai'; import type { AgentConfig } from '../types/agentConfig.js'; import type { TurnControl } from '../types/channel.js'; import type { RunState } from './durable/types.js'; import type { RunStore } from './durable/RunStore.js'; import { type HostGuardVerdict, type ClassifyHostOptions } from './select.js'; export type { HostGuardVerdict }; export declare function startHostControlGuard(options: { agent: AgentConfig; run: RunState; model: LanguageModel; classify?: (opts: ClassifyHostOptions) => Promise; emit?: (part: import('../types/stream.js').StreamPart) => void; abortSignal?: AbortSignal; runStore?: RunStore; }): Promise; export declare function isValidControl(control: TurnControl, agent: AgentConfig, run: RunState): boolean; export declare function isValidGuardVerdict(verdict: HostGuardVerdict, agent: AgentConfig, run: RunState): boolean; export declare function guardVerdictToControl(verdict: HostGuardVerdict): TurnControl | undefined; /** * Main model control wins when valid. The guard is a forgot-to-route net, NOT a * second-guesser: it only overrides when the answering model produced neither a * control tool NOR a substantive answer (`mainAnswered`). If the model answered, * the answer stands — a guard verdict must not hijack a correct keep answer * (which caused observed mis-routes of Q&A turns into flows). */ export declare function resolveHostControl(mainControl: TurnControl | undefined, guardVerdict: HostGuardVerdict | undefined, agent: AgentConfig, run: RunState, mainAnswered: boolean): TurnControl | undefined;