/** * Aura Protocol - Agent Types * * Agents are specialized workers that execute within zones. * Each agent has a specific role and can only operate within its assigned zone. */ import { ZoneContext, ZoneFinding, AgentResult } from '../zones/types.js'; export { AgentResult } from '../zones/types.js'; export type AgentRole = 'scanner' | 'policy' | 'validator' | 'reporter' | 'notifier'; export type AgentStatus = 'idle' | 'running' | 'complete' | 'error' | 'disabled'; export interface AgentConfig { id: string; name: string; role: AgentRole; description: string; enabled: boolean; externalTool?: string; config?: Record; } export interface AgentCapabilities { fileTypes?: string[]; languages?: string[]; requiresExternalTool: boolean; supportsParallel: boolean; } /** * Base Agent Interface * * All agents must implement this interface. */ export interface Agent { readonly config: AgentConfig; readonly capabilities: AgentCapabilities; /** * Check if the agent is available (external tools installed, etc.) */ isAvailable(): Promise; /** * Execute the agent within a zone context */ execute(context: ZoneContext): Promise; /** * Get agent status */ getStatus(): AgentStatus; } /** * Scanner Agent Interface * * Agents that scan for secrets, vulnerabilities, etc. */ export interface ScannerAgent extends Agent { readonly config: AgentConfig & { role: 'scanner'; }; /** * Run the scan and return findings */ scan(targetPath: string, context: ZoneContext): Promise; } /** * Policy Agent Interface * * Agents that evaluate policies and context */ export interface PolicyAgent extends Agent { readonly config: AgentConfig & { role: 'policy'; }; /** * Evaluate findings against policies */ evaluate(findings: ZoneFinding[], context: ZoneContext): Promise<{ filtered: ZoneFinding[]; falsePositives: ZoneFinding[]; escalated: ZoneFinding[]; }>; } /** * Validator Agent Interface * * Agents that validate and deduplicate findings */ export interface IValidatorAgent extends Agent { readonly config: AgentConfig & { role: 'validator'; }; /** * Validate findings and remove false positives */ validate(findings: ZoneFinding[], context: ZoneContext): Promise; } /** * Reporter Agent Interface * * Agents that generate reports */ export interface ReporterAgent extends Agent { readonly config: AgentConfig & { role: 'reporter'; }; /** * Generate a report from findings */ generateReport(findings: ZoneFinding[], format: 'sarif' | 'json' | 'html' | 'markdown', context: ZoneContext): Promise; } /** * Notifier Agent Interface * * Agents that send notifications */ export interface NotifierAgent extends Agent { readonly config: AgentConfig & { role: 'notifier'; }; /** * Send notification about findings */ notify(findings: ZoneFinding[], channel: string, context: ZoneContext): Promise; } /** * Agent Registry * * Stores all available agents */ export interface AgentRegistry { register(agent: Agent): void; unregister(agentId: string): void; get(agentId: string): Agent | undefined; getAll(): Agent[]; getByRole(role: AgentRole): Agent[]; getAvailable(): Promise; } /** * Default agent configurations */ export declare const DEFAULT_AGENTS: AgentConfig[];