/** * Agent registry for managing AI agent implementations * Singleton registry that maps agent names to implementations */ import type { Config } from "../config.js"; import type { AgentName } from "./agentNames.js"; import type { Skillset } from "../../norijson/skillset.js"; /** * Unified loader interface for AgentConfig * Each loader handles installing a specific feature. * Receives agent config and optional skillset for path resolution. * Declares which files/dirs it manages for manifest tracking. */ export type AgentLoader = { name: string; description: string; managedFiles?: ReadonlyArray | null; managedDirs?: ReadonlyArray | null; run: (args: { agent: AgentConfig; config: Config; skillset?: Skillset | null; }) => Promise; uninstall?: (args: { agent: AgentConfig; installDir: string; }) => Promise; }; /** * Represents a discovered configuration artifact for an agent. * Used by factory reset to show what will be deleted. */ export type AgentArtifact = { path: string; type: "directory" | "file"; }; /** * Represents detected existing (unmanaged) configuration for an agent. * Used during init to show the user what was found before capturing. */ export type ExistingConfig = { configFileName: string; hasConfigFile: boolean; hasManagedBlock: boolean; hasSkills: boolean; skillCount: number; hasAgents: boolean; agentCount: number; hasCommands: boolean; commandCount: number; }; /** * Support tier for an agent: "supported" agents are well-tested end to end; * "experimental" agents are best-effort. */ export type AgentSupportTier = "supported" | "experimental"; /** * Feature capabilities derived from an agent's definition. */ export type AgentCapabilities = { mcp: boolean; hooks: boolean; statusline: boolean; transcripts: boolean; }; /** * Data-oriented agent configuration * Built exclusively from AgentDefinition rows in agentTable.ts via * buildAgentConfig. All operations are shared functions in agentOperations.ts. */ export type AgentConfig = { name: AgentName; displayName: string; description: string; supportTier: AgentSupportTier; capabilities: AgentCapabilities; getAgentDir: (args: { installDir: string; }) => string; getSkillsDir: (args: { installDir: string; }) => string; getSubagentsDir: (args: { installDir: string; }) => string; getSlashcommandsDir: (args: { installDir: string; }) => string; getInstructionsFilePath: (args: { installDir: string; }) => string; getLoaders: () => Array; getExternalSettingsFiles?: (() => ReadonlyArray) | null; getLegacyManifestPath?: (() => string) | null; getTranscriptDirectory?: (() => string) | null; getArtifactPatterns?: (() => { dirs: ReadonlyArray; files: ReadonlyArray; }) | null; }; /** * Registry singleton for managing agent implementations */ export declare class AgentRegistry { private static instance; private agents; private constructor(); /** * Get the singleton instance * @returns The AgentRegistry singleton instance */ static getInstance(): AgentRegistry; /** * Reset the singleton instance (for testing) */ static resetInstance(): void; /** * Get an agent by name * @param args - Configuration arguments * @param args.name - The agent name to look up (validated at runtime) * * @throws Error if agent not found * * @returns The agent implementation */ get(args: { name: string; }): AgentConfig; /** * Get all registered agents * @returns Array of all agent implementations */ getAll(): Array; /** * List all registered agent names * @returns Array of valid agent names */ list(): Array; /** * Get the default agent name * Used as a fallback when no agent is explicitly specified. * @returns The default agent name */ getDefaultAgentName(): AgentName; /** * Get the basenames of all agent config directories. * Used by normalizeInstallDir to strip known agent dir suffixes from paths. * @returns Array of agent directory basenames (e.g., [".claude"]) */ getAgentDirNames(): Array; } //# sourceMappingURL=agentRegistry.d.ts.map