export type AgentTier = "fast" | "balanced" | "thorough"; export type AgentColor = | "red" | "green" | "blue" | "yellow" | "cyan" | "magenta" | "white" | "gray"; export interface AgentDefinition { readonly name: string; readonly description: string; readonly tools: ReadonlyArray; readonly tier: AgentTier; readonly color: AgentColor; readonly maxTurns?: number; readonly systemPrompt?: string; readonly triggerPhrases?: ReadonlyArray; readonly capabilities?: ReadonlyArray; readonly permissions?: AgentPermissions; } export interface AgentPermissions { readonly allowedPaths?: ReadonlyArray; readonly deniedPaths?: ReadonlyArray; readonly allowedTools?: ReadonlyArray; readonly deniedTools?: ReadonlyArray; readonly requireApproval?: ReadonlyArray; } export interface AgentDefinitionFile { readonly filePath: string; readonly frontmatter: AgentFrontmatter; readonly content: string; readonly parsed: AgentDefinition; } export interface AgentFrontmatter { readonly name: string; readonly description: string; readonly tools: ReadonlyArray; readonly tier?: AgentTier; readonly color?: AgentColor; readonly maxTurns?: number; readonly triggerPhrases?: ReadonlyArray; readonly capabilities?: ReadonlyArray; readonly allowedPaths?: ReadonlyArray; readonly deniedPaths?: ReadonlyArray; } export interface AgentRegistry { readonly agents: ReadonlyMap; readonly byTrigger: ReadonlyMap; readonly byCapability: ReadonlyMap>; } export interface AgentLoadResult { readonly success: boolean; readonly agent?: AgentDefinition; readonly error?: string; readonly filePath: string; } export const DEFAULT_AGENT_DEFINITION: Partial = { tier: "balanced", color: "cyan", maxTurns: 10, tools: ["read", "glob", "grep"], capabilities: [], triggerPhrases: [], }; export const AGENT_TIER_MODELS: Record = { fast: "gpt-4o-mini", balanced: "gpt-4o", thorough: "o1", }; export const AGENT_DEFINITION_SCHEMA = { required: ["name", "description", "tools"], optional: [ "tier", "color", "maxTurns", "triggerPhrases", "capabilities", "allowedPaths", "deniedPaths", ], };