stellar-cyber-mcp-agents
Version:
Model Context Protocol (MCP) server for Stellar Cyber security operations with specialized multi-agent analysis capabilities
90 lines • 2.96 kB
TypeScript
import { BaseAgent } from '../core/base-agent.js';
import { AgentMetadata, AgentRegistry, AgentCommunicationChannel, AgentLogger, AgentMetrics, AgentHealth, AgentRequest, AgentContext, RequestPriority } from '../types/agent.js';
export interface HubAgentConfig {
maxConcurrentRequests?: number;
requestTimeout?: number;
heartbeatInterval?: number;
healthCheckInterval?: number;
loadBalancing?: 'round-robin' | 'least-busy' | 'random';
retryPolicy?: {
maxRetries: number;
backoffMultiplier: number;
initialDelay: number;
};
}
export interface WorkflowDefinition {
id: string;
name: string;
description: string;
steps: WorkflowStep[];
triggers: WorkflowTrigger[];
timeout: number;
}
export interface WorkflowStep {
id: string;
name: string;
agentType: string;
capability: string;
input: any;
condition?: string;
retryPolicy?: {
maxRetries: number;
backoffMultiplier: number;
initialDelay: number;
};
}
export interface WorkflowTrigger {
type: 'event' | 'schedule' | 'manual';
condition: string;
priority: RequestPriority;
}
export interface WorkflowExecution {
id: string;
workflowId: string;
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
currentStep: number;
startTime: Date;
endTime?: Date;
results: Map<string, any>;
errors: Map<string, any>;
context: any;
}
export declare class HubAgent extends BaseAgent {
private config;
private workflows;
private executions;
private agentLoadBalancer;
private requestQueues;
private activeRequestsMap;
constructor(metadata: AgentMetadata, registry: AgentRegistry, channel: AgentCommunicationChannel, logger: AgentLogger, metrics: AgentMetrics, config?: HubAgentConfig);
protected onInitialize(): Promise<void>;
protected onStart(): Promise<void>;
protected onStop(): Promise<void>;
protected onDestroy(): Promise<void>;
protected onHealthCheck(): Promise<AgentHealth>;
protected handleRequest(request: AgentRequest, context: AgentContext): Promise<any>;
private orchestrateWorkflow;
private executeWorkflow;
private executeWorkflowSteps;
private findAgents;
private selectAgent;
private selectAgentRoundRobin;
private selectAgentLeastBusy;
private prepareStepInput;
private replacePlaceholders;
private evaluateCondition;
private executeStepWithRetry;
private getWorkflowStatus;
private cancelWorkflow;
private registerWorkflow;
private cancelAllActiveWorkflows;
private distributeRequest;
private getAgentMetrics;
private getSystemStatus;
private handleRegistryEvent;
private startWorkflowMonitoring;
private cleanupCompletedExecutions;
private initializeDefaultWorkflows;
}
export declare function createHubAgentMetadata(): AgentMetadata;
//# sourceMappingURL=hub-agent.d.ts.map