/**
 * Agent manifest discovery, loading, validation, auto-migration, and merge.
 *
 * Agents are discovered from ~/.minion/agents/XX/agent.json on startup,
 * validated with Zod (AgentManifestSchema), and merged into the config.
 * Legacy agents.list[] entries are auto-migrated to agent.json files.
 */
import type { AgentConfig } from "../../config/types.agents.js";
import type { AgentManifest } from "./agent-manifest-schema.js";
type ManifestLogger = {
    warn: (msg: string) => void;
    info?: (msg: string) => void;
};
/**
 * Discover agent.json manifests from agent subdirectories.
 *
 * Scans agentsBaseDir for subdirectories containing agent.json (or minion.json
 * as fallback). Each manifest is parsed with JSON5 and validated with
 * AgentManifestSchema. Malformed manifests are skipped with a warning.
 */
export declare function discoverAgentManifests(params: {
    agentsBaseDir: string;
    logger: ManifestLogger;
}): AgentManifest[];
/**
 * Auto-migrate agents.list[] entries to agent.json manifest files.
 *
 * For each agent in agentsList that does NOT have an existing agent.json,
 * writes a new agent.json with manifest-appropriate fields (excluding
 * deployment fields like model, sandbox, workspace).
 */
export declare function migrateAgentsListToManifests(params: {
    agentsList: AgentConfig[];
    agentsBaseDir: string;
    logger: ManifestLogger;
}): void;
/**
 * Merge a manifest with an agents.list[] entry. List entry fields
 * override manifest fields where defined (gateway.json wins).
 */
export declare function mergeManifestWithListEntry(manifest: AgentManifest, listEntry: Partial<AgentConfig>): AgentConfig;
/** @internal — test-only reset for the dedup set. */
export declare function resetManifestFieldWarningsForTest(): void;
export declare function injectDiscoveredAgents(params: {
    manifests: AgentManifest[];
    existingList: AgentConfig[];
    logger: ManifestLogger;
}): AgentConfig[];
/**
 * Watch agent directories for agent.json changes.
 *
 * Uses fs.watch with recursive: true and 500ms debounce (same pattern as
 * template-loader.ts). Only reacts to files named agent.json. Deleted
 * agent.json files log a warning but do NOT trigger onReload (per CONTEXT.md
 * "detect-but-don't-remove deletions").
 *
 * Returns a stop function that closes all watchers.
 */
export declare function watchAgentManifests(params: {
    agentsBaseDir: string;
    onReload: (agentId: string) => void;
    logger: ManifestLogger;
}): {
    stop: () => void;
};
export {};
