/** * Gateway REST helpers for multi-agent management. */ import type { AgentModelsOverride, EffectiveAgentConfig, SkillOverride } from '../agent-config/index.js'; import type { Config } from '../config/schema.js'; export type GatewayAgentRow = { id: string; name?: string; description?: string; language?: string; /** Value from `IDENTITY.md` **Avatar:** line when present (may be URL, `xopc:…`, etc.). */ avatar?: string; workspace: string; /** Absolute directory for profile Markdown (`SOUL.md`, …) and gateway avatars: `agents//profile/`. */ profileDir: string; override: Config['agents']['list'][number]; effective: EffectiveAgentConfig; sources: Record; isDefault: boolean; }; export type GatewayAgentsListResponse = { defaultId: string; agents: GatewayAgentRow[]; builtinToolIds: string[]; }; export type GatewayAgentEffectiveConfigResponse = { config: EffectiveAgentConfig; sources: Record; }; /** Extract `**Avatar:**` value from profile IDENTITY.md (same line shape as the gateway console parser). */ export declare function extractAvatarFromIdentityMarkdown(content: string): string | undefined; export declare function parseIdentityMarkdown(content: string): { name?: string; description?: string; language?: string; avatar?: string; }; export declare function listGatewayAgents(cfg: Config, _options?: { locale?: string; }): Promise; export declare function getGatewayAgentEffectiveConfig(cfg: Config, agentIdRaw: string): AgentAdminResult; export type CreateAgentBody = { /** Optional id seed; normalized agent id defaults from the profile name when omitted. */ id?: string; workspace?: string; profile: NonNullable; }; export type AgentAdminHttpStatus = 400 | 404 | 409; export type AgentAdminResult = { ok: true; data: T; } | { ok: false; error: string; status?: AgentAdminHttpStatus; }; export declare function prepareCreateAgent(cfg: Config, body: CreateAgentBody): AgentAdminResult<{ nextConfig: Config; agentId: string; workspace: string; }>; export declare function finalizeCreateAgentDirs(cfg: Config, agentId: string): Promise>; export type UpdateAgentBody = { workspace?: string | null; profile?: Config['agents']['list'][number]['profile'] | null; models?: AgentModelsOverride | null; setDefault?: boolean; skills?: SkillOverride | null; tools?: NonNullable[number]['tools'] | null; workflows?: NonNullable[number]['workflows'] | null; runtime?: NonNullable[number]['runtime'] | null; }; export declare function prepareUpdateAgent(cfg: Config, agentIdRaw: string, body: UpdateAgentBody): AgentAdminResult<{ nextConfig: Config; }>; export declare function prepareDeleteAgent(cfg: Config, agentIdRaw: string): AgentAdminResult<{ nextConfig: Config; agentId: string; }>; export declare function runAfterDeletePurge(cfg: Config, agentId: string): Promise; export type AgentFileEntry = { name: string; missing: boolean; size?: number; updatedAtMs?: number; }; export declare function listAgentProfileFiles(cfg: Config, agentId: string): Promise>; export declare function readAgentProfileFile(cfg: Config, agentId: string, name: string): Promise>; export declare function writeAgentProfileFile(cfg: Config, agentId: string, name: string, content: string): Promise>; export declare function readAgentAvatarFile(cfg: Config, agentId: string): Promise>; export declare function writeAgentAvatarFromBase64(cfg: Config, agentId: string, base64: string, mimeType: string): Promise>; /** Remove any `agent-avatar.*` in the agent profile markdown root. Idempotent: ok even when no file existed. */ export declare function deleteAgentAvatarFile(cfg: Config, agentId: string): Promise>;