/** * LLM-accessible tools covering every provider/model/fallback configurable area * in the system: favorites, fallback chains & profiles, provider management, * API key handling, leader model, per-role model assignment, and system view. * * DESIGN: Every operation that accepts a provider/model reference validates * the entry against the user's `favoriteModels` list FIRST. This means all * fallback additions, profiles, and role assignments are restricted to * user-curated favorites — the LLM cannot add arbitrary unknown models. * * Exceptions: * - Removing entries (chain, profile, favorites) works on any existing entry. * - Listing/viewing works unconditionally. * - The active leader model itself is not restricted (it's already set). * * Tools (8 total): * favorite_manage — List, add, remove favorite models. * fallback_chain_manage — View, add, insert, remove, clear the active chain. * fallback_profile_manage — List, create/update, delete named profiles. * agent_model_assign — Assign model/profile to role/phase/* in the matrix. * provider_manage — List, add, configure, remove provider entries. * provider_key_set — Set API key via env var, direct key, or interactive prompt. * leader_model_set — View/set leader model, derive from profile, toggle settings. * system_config_view — Comprehensive view + validation doctor for full config. * * Usage from an agent: * ``` * favorite_manage({ action: "list" }) * favorite_manage({ action: "add", model: "anthropic/claude-sonnet-4" }) * fallback_chain_manage({ action: "add", model: "anthropic/claude-haiku-3" }) * fallback_profile_manage({ action: "set", name: "fast", chain: ["openai/gpt-4o-mini"] }) * agent_model_assign({ role: "security-scanner", provider: "anthropic", model: "claude-haiku-3" }) * provider_key_set({ provider: "openai", envVar: "OPENAI_API_KEY" }) * leader_model_set({ action: "show" }) * system_config_view({ section: "all" }) * ``` */ import type { Config } from '../types/config.js'; import type { Logger } from '../types/logger.js'; import type { Tool } from '../types/tool.js'; export declare const FAVORITE_MANAGE_TOOL_NAME = "favorite_manage"; export declare const FALLBACK_CHAIN_MANAGE_TOOL_NAME = "fallback_chain_manage"; export declare const FALLBACK_PROFILE_MANAGE_TOOL_NAME = "fallback_profile_manage"; export declare const AGENT_MODEL_ASSIGN_TOOL_NAME = "agent_model_assign"; export interface FallbackManageToolOptions { /** Returns the live config (re-read each call so changes are honored). */ getConfig: () => Config; /** * Persist config mutations. Receives a mutator that receives the config * as a mutable JSON object — the tool sets the relevant fields and the * host writes back atomically + mirrors into the in-memory store. */ updateConfig: (mutate: (cfg: Record) => void) => Promise; /** * Optional callback for requesting secure interactive input from the user. * When provided, tools like `provider_key_set` can use it to prompt the * user for secret values (API keys, tokens) without the value passing * through the LLM's context. The prompt string is shown to the user and * the returned string is the value they entered. * * When absent, `provider_key_set` returns a `needs_key` status and the * host is expected to handle it through other means (env var, CLI command). */ requestInput?: ((prompt: string) => Promise) | undefined; /** Optional logger for internal warnings. */ logger?: Logger | undefined; } export declare const PROVIDER_MANAGE_TOOL_NAME = "provider_manage"; export declare const PROVIDER_KEY_SET_TOOL_NAME = "provider_key_set"; export declare const LEADER_MODEL_SET_TOOL_NAME = "leader_model_set"; export declare const SYSTEM_CONFIG_VIEW_TOOL_NAME = "system_config_view"; /** * Create all 8 provider/model/fallback management tools that LLMs can call. * * Register them all in the tool registry: * ```ts * const tools = createFallbackManageTools({ getConfig, updateConfig }); * for (const tool of tools) toolRegistry.register(tool); * ``` */ export declare function createFallbackManageTools(opts: FallbackManageToolOptions): Tool[]; //# sourceMappingURL=fallback-manage-tools.d.ts.map