/** * [WHO]: loadAgentDefinitionsFromDirectory, parseMarkdownAgentDefinition, parseJsonAgentDefinition * [FROM]: Depends on node:fs/promises, node:path, ./agent-definition for AgentDefinition types * [TO]: Consumed by ./agent-registry (reload), extensions/builtin/subagent/* * [HERE]: core/sub-agent/agent-definition-loader.ts - Custom agent definition loader per CC §XV (mM4/uM4) * [COVENANT]: Change format → update agent-registry reload and agent-definition interface */ import type { AgentDefinition, AgentDefinitionSource } from "./agent-definition.js"; /** * Parse a markdown agent definition file. * Matches CC's mM4() function for parsing .claude/agents/*.md * (adapted to .catui/agents/*.md). * * Format (CC §15.1): * ```markdown * --- * name: my-agent * description: "A specialized agent for X" * tools: ["Read", "Glob", "Grep"] * disallowedTools: ["Write"] * model: sonnet * effort: high * permissionMode: plan * maxTurns: 10 * background: false * memory: project * isolation: worktree * skills: ["skill-name"] * initialPrompt: "..." * appendSystemPrompt: true * mcpServers: ["server-name"] * --- * * You are a specialized agent for X. * ``` */ export declare function parseMarkdownAgentDefinition(content: string, filePath: string, source?: AgentDefinitionSource): AgentDefinition | null; /** * Parse a JSON agent definition (plugin format). * Matches CC's uM4() function for JSON agent definitions. * * Format (CC §15.2): * ```json * { * "agents": { * "my-agent": { * "description": "A specialized agent for X", * "tools": ["Read", "Glob", "Grep"], * "prompt": "You are a specialized agent for X...", * "model": "sonnet", * "permissionMode": "plan", * "maxTurns": 10, * "background": false, * "memory": "project", * "isolation": "worktree" * } * } * } * ``` */ export declare function parseJsonAgentDefinition(content: string, filePath: string, source?: AgentDefinitionSource): AgentDefinition[]; /** * Load all agent definitions from a directory. * Scans for .md and .json files and parses them. * * Per CC §XIV: * - Sources: built-in, plugin, user custom (.catui/agents/*.md) * - Failed files are recorded for error reporting * * @param dirPath Directory to scan for agent definitions * @param source Source classification for loaded definitions * @returns Array of successfully parsed definitions and failed file entries */ export declare function loadAgentDefinitionsFromDirectory(dirPath: string, source?: AgentDefinitionSource): Promise<{ definitions: AgentDefinition[]; failedFiles: Array<{ path: string; error: string; }>; }>; /** * Load custom agent definitions from the standard locations. * Per CC §XIV: * - .catui/agents/*.md (project-scoped) * - ~/.catui/agents//agents/*.md (user-scoped) * * @param cwd Project root directory * @param agentDir Global agent config directory */ export declare function loadCustomAgentDefinitions(cwd: string, agentDir: string): Promise<{ definitions: AgentDefinition[]; failedFiles: Array<{ path: string; error: string; }>; }>;