//#region src/config/types.d.ts /** * Agent configuration types for AIMax multi-agent support. * Compatible with the .aimax/agents.json config file. */ /** * Single agent configuration. * Each agent can have its own model, skills, identity, and subagent settings. */ type AgentConfig = { /** Unique agent identifier */id: string; /** Whether this is the default agent */ default?: boolean; /** Display name (overrides identity.name) */ name?: string; /** Model configuration (string or object with primary/fallbacks) */ model?: string | AgentModelConfig; /** Skills allowlist (omit = all skills; empty = none) */ skills?: string[]; /** Identity configuration for display/persona */ identity?: { name?: string; theme?: string; emoji?: string; avatar?: string; }; /** Subagent configuration for this agent */ subagents?: { /** Allow spawning subagents under other agent ids. Use "*" to allow any. */allowAgents?: string[]; /** Per-agent default model for spawned subagents (string or {primary,fallbacks}). */ model?: string | AgentModelConfig; }; }; /** * Model configuration with primary and optional fallbacks. */ type AgentModelConfig = { primary: string; fallbacks?: string[]; }; /** * Routing binding configuration. * Maps channel/account/peer to a specific agent. */ type AgentBinding = { /** Target agent ID for this binding */agentId: string; /** Optional comment/description */ comment?: string; /** Match conditions for this binding */ match: { /** Channel type: H5 | WEB | KLPA | TASK | CRON | EIP_ASSISTANT */channel: "H5" | "WEB" | "KLPA" | "TASK" | "CRON" | "EIP_ASSISTANT"; /** Account ID (optional, for multi-account routing) */ accountId?: string; /** User ID (optional, for user-specific routing) */ userId?: string; }; }; /** * Root agents configuration structure. * Stored in .aimax/agents.json */ type AgentsConfig = { /** List of configured agents */agents: AgentConfig[]; /** Routing bindings (channel -> agent mapping) */ bindings?: AgentBinding[]; /** Default configuration (optional) */ defaults?: { model?: string | AgentModelConfig; /** * Maximum number of recent user turns to keep in context. * 0 or undefined means no limit. */ historyLimit?: number; /** LLM-based history compaction settings */ compaction?: { /** Whether to enable automatic LLM summarisation; defaults to true */enabled?: boolean; /** Fraction of context window that triggers compaction; defaults to 0.6 */ thresholdRatio?: number; }; }; }; //#endregion //#region src/config/agents-config.d.ts /** * Resolves the .aimax directory path within a data directory. */ declare function aimaxDir(dataDir: string): string; /** * Resolves the agents configuration file path. */ declare function resolveAgentsConfigPath(dataDir: string): string; /** * Resolves the agent-specific directory path. */ declare function resolveAgentDir(dataDir: string, agentId: string): string; /** * Loads the agents configuration from disk. * Returns a default config if the file doesn't exist. */ declare function loadAgentsConfig(dataDir: string): Promise; /** * Saves the agents configuration to disk. */ declare function saveAgentsConfig(dataDir: string, config: AgentsConfig): Promise; /** * Lists all valid agent configurations. */ declare function listAgents(config: AgentsConfig): AgentConfig[]; /** * Gets the default agent ID. * Returns the first agent marked as default, or "main" if none found. */ declare function resolveDefaultAgentId(config: AgentsConfig): string; /** * Normalizes an agent ID (lowercase, trimmed). */ declare function normalizeAgentId(id: string | undefined): string; /** * Gets an agent configuration by ID. */ declare function getAgentConfig(config: AgentsConfig, agentId: string): AgentConfig | undefined; /** * Lists all routing bindings. */ declare function listBindings(config: AgentsConfig): AgentBinding[]; /** * Resolves the agent ID for a given channel/account/user combination. * Returns the agent ID from the first matching binding, or the default agent ID. */ declare function resolveAgentIdByBinding(config: AgentsConfig, channel: string, accountId?: string, userId?: string): string; /** * Resolves the model string from an AgentModelConfig or plain string. */ declare function resolveModelString(model: string | AgentModelConfig | undefined): string | undefined; /** * Resolves the model fallbacks from an AgentModelConfig. */ declare function resolveModelFallbacks(model: string | AgentModelConfig | undefined): string[] | undefined; /** * Adds a new agent to the configuration. * Returns false if an agent with the same ID already exists. */ declare function addAgent(dataDir: string, agent: AgentConfig): Promise; /** * Removes an agent from the configuration. * Returns false if the agent doesn't exist or is the default agent. */ declare function removeAgent(dataDir: string, agentId: string): Promise; /** * Adds a routing binding to the configuration. */ declare function addBinding(dataDir: string, binding: AgentBinding): Promise; /** * Removes routing bindings matching the given criteria. * If channel is "*", removes all bindings for the agent. */ declare function removeBindings(dataDir: string, agentId: string, channel?: string, accountId?: string): Promise; /** * Updates an existing agent's configuration fields. * Returns false if the agent doesn't exist. */ declare function updateAgent(dataDir: string, agentId: string, updates: Partial>): Promise; /** * Updates an agent's identity configuration. */ declare function updateAgentIdentity(dataDir: string, agentId: string, identity: Partial>): Promise; //#endregion //#region src/config/profile/types.d.ts type CommandRule = { pattern?: string; description?: string; enabled?: boolean; builtin?: boolean; [key: string]: unknown; }; type CommandRuleGroup = { enabled?: boolean; rules?: CommandRule[]; [key: string]: unknown; }; type ProfileConfig = { "command-rules"?: { blacklist?: CommandRuleGroup; whitelist?: CommandRuleGroup; [key: string]: unknown; }; tools?: { /** Tool names to remove from the loaded tool set at runtime. */disabledList?: string[]; [key: string]: unknown; }; [key: string]: unknown; }; //#endregion //#region src/config/profile/profile-config.d.ts declare const PROFILE_CONFIG_FILE = "config.yaml"; /** Default config directory: /.aimax */ declare function defaultConfigDir(dataDir: string): string; /** * Profile config directory: the profilePath itself. * Profile files live directly in the profile directory (no .aimax nesting). */ declare function profileConfigDir(profilePath: string): string; declare function loadMergedProfileConfig(dataDir: string, profilePath?: string): Promise; declare function mergeProfileConfig(base: ProfileConfig, override: ProfileConfig): ProfileConfig; //#endregion export { AgentModelConfig as A, resolveModelFallbacks as C, updateAgentIdentity as D, updateAgent as E, AgentBinding as O, resolveDefaultAgentId as S, saveAgentsConfig as T, removeAgent as _, profileConfigDir as a, resolveAgentIdByBinding as b, ProfileConfig as c, aimaxDir as d, getAgentConfig as f, normalizeAgentId as g, loadAgentsConfig as h, mergeProfileConfig as i, AgentsConfig as j, AgentConfig as k, addAgent as l, listBindings as m, defaultConfigDir as n, CommandRule as o, listAgents as p, loadMergedProfileConfig as r, CommandRuleGroup as s, PROFILE_CONFIG_FILE as t, addBinding as u, removeBindings as v, resolveModelString as w, resolveAgentsConfigPath as x, resolveAgentDir as y };