/**
 * Subagent management -- discovery, installation, and format conversion.
 *
 * Subagents are named agent definitions in ~/.agents/subagents/, each a directory
 * with an agent.md file (frontmatter + instructions). This module discovers them,
 * transforms them into agent-native formats (Claude .mdc, OpenClaw YAML),
 * and syncs them into version homes.
 */
import type { AgentId, DiscoveredSubagent, InstalledSubagent, SubagentFrontmatter } from './types.js';
/**
 * Parse AGENT.md frontmatter to extract subagent metadata
 */
export declare function parseSubagentFrontmatter(filePath: string): SubagentFrontmatter | null;
/**
 * Get the body content of AGENT.md (everything after frontmatter)
 */
export declare function getSubagentBody(filePath: string): string;
/**
 * Discover subagents from a repository
 * Looks for subagents/{name}/AGENT.md
 */
export declare function discoverSubagentsFromRepo(repoPath: string): DiscoveredSubagent[];
/**
 * List installed subagents from ~/.agents/subagents/
 */
export declare function listInstalledSubagents(): InstalledSubagent[];
/**
 * Get a specific installed subagent
 */
export declare function getInstalledSubagent(name: string): InstalledSubagent | null;
/**
 * Install a subagent centrally to ~/.agents/subagents/{name}/
 */
export declare function installSubagentCentrally(sourcePath: string, name: string): {
    success: boolean;
    error?: string;
};
/**
 * Remove an installed subagent
 */
export declare function removeSubagent(name: string): {
    success: boolean;
    error?: string;
};
/**
 * Transform a subagent directory into a single .md file for Claude
 * Combines AGENT.md frontmatter + body with other files as sections
 */
export declare function transformSubagentForClaude(subagentDir: string): string;
/**
 * Transform a subagent into a Factory AI Droid "custom droid" .md file.
 *
 * Mirrors transformSubagentForClaude (flatten frontmatter + body + appended
 * .md sections), but emits only frontmatter keys Factory recognizes
 * (name, description, model). Factory has no `color` field, so it is dropped.
 * See https://docs.factory.ai/cli/configuration/custom-droids.
 */
export declare function transformSubagentForDroid(subagentDir: string): string;
/**
 * Transform a subagent into a GitHub Copilot CLI custom agent `.agent.md` file.
 *
 * Copilot custom agents are Markdown profiles with YAML frontmatter stored in
 * `~/.copilot/agents/` (user) or `.github/agents/` (project). The file name
 * ends in `.agent.md` and the frontmatter carries `name`, `description`, and
 * optionally `model` and `tools`. The emitted body is identical to Factory
 * Droid's custom-droid format (flatten frontmatter + body + appended .md
 * sections, `color` dropped), so this is an alias of transformSubagentForDroid.
 * See GitHub docs for custom agents.
 */
export declare function transformSubagentForCopilot(subagentDir: string): string;
/**
 * Transform a subagent into a Cursor CLI custom subagent `.md` file.
 *
 * Cursor loads subagents from `.cursor/agents/*.md` (project) or
 * `~/.cursor/agents/*.md` (user) — Markdown with YAML frontmatter
 * (name, description, model; also readonly/is_background, which our
 * frontmatter schema doesn't carry). Cursor has no `color` field, so this is
 * an alias of transformSubagentForDroid, same as Copilot.
 * See https://cursor.com/docs/subagents.
 */
export declare function transformSubagentForCursor(subagentDir: string): string;
/**
 * Transform a subagent into Antigravity's custom-agent markdown shape.
 *
 * Antigravity exposes custom agents as Markdown files with YAML frontmatter,
 * close to Gemini CLI subagents. Keep portable frontmatter fields and flatten
 * sibling markdown files into the prompt body like the other markdown-backed
 * agents.
 */
export declare function transformSubagentForAntigravity(subagentDir: string): string;
/**
 * Transform a subagent into an OpenCode agent markdown file.
 *
 * OpenCode loads agents from ~/.config/opencode/agents/*.md (global) with
 * YAML frontmatter (description required; mode: subagent for invocable
 * subagents) and a prompt body. File stem becomes the agent name.
 * https://opencode.ai/docs/agents/
 */
export declare function transformSubagentForOpenCode(subagentDir: string): string;
/**
 * Transform a subagent into a Codex custom-agent TOML file.
 *
 * Codex loads standalone TOML under ~/.codex/agents/*.toml. Required fields:
 * name, description, developer_instructions. Optional model maps from our
 * frontmatter when present.
 * https://developers.openai.com/codex/subagents (custom agents section)
 */
export declare function transformSubagentForCodex(subagentDir: string): string;
/**
 * Transform a subagent into a Goose recipe YAML file.
 *
 * Goose has no dedicated subagent file format — a named subagent IS a recipe.
 * Goose resolves named agents from `~/.config/goose/agents/<name>.yaml` (global)
 * and delegates to them by name in autonomous mode. The recipe schema mirrors the
 * one agents-cli already emits for Goose workflow recipes (`writeGooseSubrecipe`):
 * `version`, `title`, `description`, `instructions`, `prompt`, plus an optional
 * `settings.goose_model`. See goose-docs.ai context-engineering/subagents.
 */
export declare function transformSubagentForGoose(subagentDir: string): string;
/**
 * Sync a subagent to an OpenClaw workspace
 * Copies full directory, renames AGENT.md to AGENTS.md
 */
export declare function syncSubagentToOpenclaw(subagentDir: string, targetDir: string): {
    success: boolean;
    error?: string;
};
/**
 * Install a subagent to a specific agent's home
 */
export declare function installSubagentToAgent(subagentDir: string, subagentName: string, agent: AgentId, agentHome: string): {
    success: boolean;
    error?: string;
};
/**
 * Remove a subagent from a specific agent's home
 */
export declare function removeSubagentFromAgent(subagentName: string, agent: AgentId, agentHome: string): {
    success: boolean;
    error?: string;
};
/**
 * Check if subagent content matches between source and installed
 */
export declare function subagentContentMatches(installedDir: string, sourceDir: string): boolean;
/**
 * List subagents installed to a specific agent's home.
 *
 * Layout (target dir, file/dir shape, metadata reader) is declared once per
 * agent in the subagent registry; this is a thin wrapper over the generic
 * enumerator so a new agent needs no arm here -- just a registry entry.
 */
export declare function listSubagentsForAgent(agentId: AgentId, home: string): InstalledSubagent[];
export interface VersionSubagentDiff {
    agent: AgentId;
    version: string;
    orphans: string[];
}
/**
 * Compare a version home's subagents against discovered subagents.
 * Returns orphan subagent names.
 */
export declare function diffVersionSubagents(agent: AgentId, version: string): VersionSubagentDiff;
/**
 * Iterate all (agent, version) pairs that support subagents and are installed.
 */
export declare function iterSubagentsCapableVersions(filter?: {
    agent?: AgentId;
    version?: string;
}): Array<{
    agent: AgentId;
    version: string;
}>;
/**
 * Remove a single subagent from a specific version home.
 * Soft-deletes to ~/.agents/.trash/subagents/.
 */
export declare function removeSubagentFromVersion(agent: AgentId, version: string, subagentName: string): {
    success: boolean;
    error?: string;
};
