snow-flow
Version:
Snow-Flow v3.2.0: Complete ServiceNow Enterprise Suite with 180+ MCP Tools. ATF Testing, Knowledge Management, Service Catalog, Change Management with CAB scheduling, Virtual Agent chatbots with NLU, Performance Analytics KPIs, Flow Designer automation, A
92 lines • 2.76 kB
TypeScript
/**
* Base Agent Class
* Common functionality for all ServiceNow specialist agents
*/
import { Agent, AgentMessage, ServiceNowArtifact, AgentType } from '../queen/types';
import { QueenMemorySystem } from '../queen/queen-memory';
export interface AgentConfig {
id?: string;
type: AgentType;
capabilities: string[];
mcpTools: string[];
memoryPath?: string;
debugMode?: boolean;
}
export interface AgentResult {
success: boolean;
artifacts?: ServiceNowArtifact[];
message?: string;
error?: Error;
metadata?: Record<string, any>;
}
export declare abstract class BaseAgent implements Agent {
id: string;
type: AgentType;
status: Agent['status'];
task?: string;
capabilities: string[];
mcpTools: string[];
protected memory: QueenMemorySystem;
protected debugMode: boolean;
protected messageQueue: AgentMessage[];
constructor(config: AgentConfig);
/**
* Execute the agent's main task
* Must be implemented by each specific agent
*/
abstract execute(instruction: string, context?: Record<string, any>): Promise<AgentResult>;
/**
* Validate agent can handle the task
* Can be overridden by specific agents
*/
canHandle(instruction: string): Promise<boolean>;
/**
* Store artifact in shared memory for other agents
*/
protected storeArtifact(artifact: ServiceNowArtifact): Promise<void>;
/**
* Retrieve artifact from shared memory
*/
protected getArtifact(type: string, name: string): Promise<ServiceNowArtifact | null>;
/**
* Report progress to Queen Agent
*/
protected reportProgress(message: string, percentage: number): Promise<void>;
/**
* Send message to another agent
*/
protected sendMessage(to: string, type: AgentMessage['type'], content: any): void;
/**
* Retrieve messages for this agent
*/
protected getMessages(): Promise<AgentMessage[]>;
/**
* Handle coordination with other agents
*/
protected coordinateWith(agentType: AgentType, request: any): Promise<any>;
/**
* Log activity for learning
*/
protected logActivity(action: string, success: boolean, details?: any): Promise<void>;
/**
* Update agent status
*/
protected setStatus(status: Agent['status']): void;
/**
* Check if agent should work with another agent
*/
protected shouldCoordinate(otherAgentType: AgentType): boolean;
/**
* Generate unique agent ID
*/
private generateAgentId;
/**
* Get agent information
*/
getInfo(): Record<string, any>;
/**
* Cleanup agent resources
*/
cleanup(): Promise<void>;
}
//# sourceMappingURL=base-agent.d.ts.map