import { EntityManager } from 'typeorm'; import { Domain } from '@things-factory/shell'; /** One of this domain's own agents as the settings card sends it. No id means a new agent. */ export interface AiAgentWrite { id?: string; name: string; provider: string; model: string; baseURL?: string; organization?: string; /** The model the agent makes pictures with (ADR-0226 decision 8-1) - its provider's default when empty. */ imageModel?: string; active: boolean; /** A new key. Left out, the stored key stays (ADR-0112 decision 3). */ apiKey?: string; } /** This domain's key for an agent it inherits - set one, or clear it to go back to the key above. */ export interface InheritedKeyWrite { agentId: string; apiKey?: string; clear?: boolean; } export interface AiAgentsWrite { /** The whole list of this domain's own agents. One that is left out is deleted. */ agents: AiAgentWrite[]; defaultAgentId?: string; turnedOff?: string[]; inheritedKeys?: InheritedKeyWrite[]; } /** * Saves a domain's agents and their keys in one transaction, touching only the request domain's rows - except that * deleting an agent also removes the keys domains below had set for it (design/ai/agent-settings.md §3-2, §3-3). */ export declare function saveAiAgents(write: AiAgentsWrite, { tx, domain, user }: { tx: EntityManager; domain: Domain; user?: { id: string; }; }): Promise;