/**
 * Agent Registry Service
 *
 * Infrastructure implementation of the IAgentRegistry port.
 * Manages agent workflow definitions in an in-memory map,
 * enabling runtime discovery and instantiation of agent workflows.
 *
 * Pre-registers built-in agents (analyze-repository) at construction time.
 */
import { createAnalyzeRepositoryGraph } from '../analyze-repo/analyze-repository-graph.js';
import { createFeatureAgentGraph } from '../feature-agent/feature-agent-graph.js';
export class AgentRegistryService {
    agents = new Map();
    constructor() {
        // Register built-in agents
        this.register({
            name: 'analyze-repository',
            description: 'Analyze repository structure, dependencies, and architecture',
            graphFactory: createAnalyzeRepositoryGraph,
        });
        this.register({
            name: 'feature-agent',
            description: 'Autonomous SDLC agent: analyze → requirements → research → plan → implement',
            graphFactory: createFeatureAgentGraph,
        });
    }
    register(definition) {
        this.agents.set(definition.name, definition);
    }
    get(name) {
        return this.agents.get(name);
    }
    list() {
        return Array.from(this.agents.values());
    }
}
