/** * An AI agent - a provider, a model and a key that together can answer (design/ai/agent-settings.md ยง3). * * A domain keeps its agents in one Setting row (`ai-agents`) and each key in an EnvVar of its own, so the * definition and the secret live where the framework already keeps domain settings and secrets (ADR-0112). * This file is the shape and its parsing - no database. */ /** * The providers an agent may name. Three, by decision (2026-10-12); and claude-code (2026-11-13): Claude Code logged in * on the server's own machine, for development -- it needs no key, and is offered only where it can answer. */ export declare const AI_AGENT_PROVIDERS: readonly ["openai", "anthropic", "gemini", "claude-code"]; export type AiAgentProvider = (typeof AI_AGENT_PROVIDERS)[number]; /** A provider whose agent needs no API key: it answers on what the server's machine is logged in to. */ export declare function aiProviderNeedsKey(provider: string): boolean; /** Whether this server can use the provider at all: claude-code only on a development server with the CLI logged in. */ export declare function aiProviderAvailable(provider: string): boolean; /** The providers this server offers, for the settings screen. */ export declare function aiProvidersOffered(): AiAgentProvider[]; /** The Setting row that holds a domain's agents. */ export declare const AI_AGENTS_SETTING = "ai-agents"; export declare const AI_AGENTS_SETTING_CATEGORY = "ai"; export interface AiAgentSpec { id: string; name: string; provider: AiAgentProvider; model: string; baseURL?: string; /** OpenAI only. */ organization?: string; /** The model this agent makes pictures with (ADR-0226 decision 8-1) - its provider's default when empty. */ imageModel?: string; /** Off takes the agent out of this domain and every domain below it. */ active: boolean; } /** What the `ai-agents` Setting row holds for one domain. */ export interface AiAgentsSetting { agents: AiAgentSpec[]; /** This domain's default - one of its own agents or an inherited one. */ defaultAgentId?: string; /** Inherited agents this domain does not use. */ turnedOff?: string[]; } /** The EnvVar that holds an agent's key. Named by the agent id, so renaming an agent keeps its key. */ export declare function aiAgentKeyName(agentId: string): string; export declare const AI_AGENT_KEY_PREFIX = "AiAgent::"; export declare function isAiAgentProvider(value: unknown): value is AiAgentProvider; /** * Reads a stored `ai-agents` value. The row can also be written through the generic setting doors, so a value that * does not parse reads as no agents, and an entry without an id, a name, a known provider or a model is left out - * a broken row never becomes an agent that fails at the provider. */ export declare function parseAiAgentsSetting(value: string | null | undefined): AiAgentsSetting; export declare function stringifyAiAgentsSetting(setting: AiAgentsSetting): string; /** The image model each provider makes pictures with when an agent names none; a provider absent here makes none. */ export declare const DEFAULT_IMAGE_MODELS: Partial>; /** The model an agent makes pictures with, or nothing when its provider makes none (Anthropic, Claude Code). */ export declare function imageModelOf(spec: Pick): string | undefined;