/** * Subagent model defaults and the settings section the TUI edits with * `/submodel` and `/subeffort`. * * The provider is deliberately inherited from the running parent session: * the subagent selection only overrides the provider when the user stored an * explicit route. When the parent provider changes, the TUI picks a * same-family default (DeepSeek flash, Grok 4.5, otherwise the first listed * lightweight model) unless `/submodel` stored an explicit model. */ import z from '@deepseek-ai/schemastery'; import type { Context } from '@deepseek-ai/cordis'; import { type ReasoningEffortId as ReasoningEffort } from '@deepseek-ai/dsh-llm'; /** Settings namespace carrying the TUI's subagent model selection. */ export declare const SUBAGENT_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace; /** Lightweight default model used for DeepSeek-family subagent children. */ export declare const DEFAULT_SUBAGENT_MODEL = "deepseek-v4-flash"; /** Preferred subagent default when the parent route is SuperGrok / xAI. */ export declare const DEFAULT_XAI_SUBAGENT_MODEL = "grok-4.5"; /** * Choose the default subagent model for a parent provider, preferring a * same-family listed model over a leftover DeepSeek flash id. When the * parent's own model id is supplied, candidates closest to that name win, * with flash-like ids ranked first. */ export declare function defaultSubagentModelForProvider(provider: string, listed?: readonly string[], parentModel?: string): string; /** * Canonical id of the supplier behind a route. * * The settings file can name the same supplier two ways — `xai` against * `grok`, `deepseek-official` against `deepseek` — and a `/submodel` pin that * spells the parent's own provider differently is still the parent's provider. * Only those aliases collapse: an id the TUI cannot vouch for (`deepseek-eu`, * `grok-mirror`, a relay) stays itself, because two routes it cannot prove * share a bill are two providers. */ export declare function canonicalProviderId(provider: string | undefined): string; /** * True when `child` is a different supplier from `parent`. * * This is the one condition that earns a subagent an accent colour: a child * that follows the parent — or that was pinned back onto the parent's own * provider — is on the parent's route and must read as such. */ export declare function subagentProviderDiffers(parent: string | undefined, child: string | undefined): boolean; /** * Which identity role a subagent chip title wears. * * The colours themselves live in `theme.ts`: the same provider as the parent * gets the identity role, a different provider gets the foreign one, and the * palette decides what those look like (under `mono` they become an attribute, * because the distinction has to survive a terminal without colour). */ export declare function subagentIdentityRole(foreign: boolean): 'subagent-self' | 'subagent-foreign'; /** * True when the stored subagent model still belongs to the parent provider * family. An explicit leftover DeepSeek flash id after switching to xAI is * treated as stale so the TUI can pick a same-family default. * * A non-empty `listed` catalog is an extra constraint, not a bypass: a dirty * directory that still contains `deepseek-v4-flash` must not keep that id on * an xAI parent. */ export declare function subagentModelMatchesProvider(provider: string, model: string, listed?: readonly string[]): boolean; /** Cheap vs expensive hint for the automatic subagent default. */ export type SubagentCostClass = 'light' | 'heavy' | 'other'; /** * Classify a model id for the subagent default. Flash / lite / mini / small * and Grok 4.5 / 4.3 count as light; pro / max / 4.6 count as heavy so * `/status` can show when the catalog had nothing cheaper. */ export declare function subagentCostClass(model: string): SubagentCostClass; /** One `/status` line describing the live subagent route vs the parent. */ export declare function describeSubagentFit(input: { parentProvider: string; parentModel?: string; subProvider?: string; subModel: string; }): { line: string; sameFamily: boolean; expensive: boolean; following: boolean; }; /** Raw settings document shape. */ export interface SubagentSettings { /** Explicit provider override; omitted means "same provider as the parent". */ provider?: string; /** Subagent model id. */ model?: string; /** Adapter-owned reasoning effort id. */ reasoningEffort?: string; } /** Live, typed subagent selection. */ export interface SubagentSelection { /** Explicit provider override; undefined inherits the parent route. */ provider?: string; /** Subagent model id. */ model: string; /** Reasoning effort; undefined follows the provider/model default. */ reasoningEffort?: ReasoningEffort; } /** Mutable selection handle shared by the settings watcher and the TUI. */ export interface SubagentSelectionRef { current: SubagentSelection; /** * Where `current` came from. * * A route restored from a session's own record (`session`) outranks the * settings watcher: the host fires `onChange` on writes to *any* section, so a * `/model` or a `/doctor --fix` would otherwise put the app-level default back * and silently drop the pin the conversation was resumed with. A user change * through `/submodel` hands ownership back to the settings. */ source?: 'settings' | 'session'; } /** * Adopt a session's own subagent route, outranking the settings watcher. * @param ref - the shared selection handle. * @param selection - the route the session's record names. */ export declare function adoptSessionSubagentSelection(ref: SubagentSelectionRef, selection: SubagentSelection): void; /** * Hand the ref back to the settings watcher. * * Called when a user change makes the settings the source again, and before a * new session starts in this process — a session-scoped route must not leak into * the next conversation. Only a readable section may replace the current value: * resetting on a settings service that is not up yet would swap the route for * the built-in default instead. */ export declare function releaseSessionSubagentSelection(ref: SubagentSelectionRef, settingsValue: unknown): void; /** Settings schema for the subagent selection; every field is form-writable. */ export declare const SUBAGENT_SETTINGS_SCHEMA: z; model: z; reasoningEffort: z; }>>, Schemastery.ObjectT; model: z; reasoningEffort: z; }>>, "plain">; /** Normalize a raw settings section into a live typed selection. */ export declare function normalizeSubagentSelection(value: unknown): SubagentSelection; /** * Install the settings-backed subagent selection for one TUI plugin fiber. * Returns the mutable ref the request waterfall and the slash commands share. */ export declare function createSubagentSelection(ctx: Context): SubagentSelectionRef; /** Serialize a live selection back into the settings document shape. */ export declare function subagentSettingsValue(selection: SubagentSelection): SubagentSettings;