UNPKG

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

164 lines 5.26 kB
/** * Queen Memory System with Hierarchical Patterns * Enhanced memory system for ServiceNow Queen Agent coordination */ import { HierarchicalMemorySystem, HierarchicalMemoryEntry } from '../memory/hierarchical-memory-system'; import { EventEmitter } from 'events'; export interface QueenMemoryPattern { 'objectives/[id]/definition': 'Store objective details and requirements'; 'objectives/[id]/_analysis': 'Task _analysis and breakdown'; 'objectives/[id]/status': 'Current status and progress'; 'agents/[id]/profile': 'Agent capabilities and status'; 'agents/[id]/tasks': 'Assigned tasks and progress'; 'agents/[id]/results': 'Task completion results'; 'artifacts/widgets/[name]': 'Service Portal widgets'; 'artifacts/flows/[name]': 'Flow Designer flows'; 'artifacts/scripts/[name]': 'Scripts and includes'; 'artifacts/deployments/[id]': 'Deployment results'; 'patterns/successful/[type]': 'Successful patterns for reuse'; 'patterns/failures/[type]': 'Failure patterns to avoid'; 'patterns/optimizations/[type]': 'Performance optimizations'; 'swarm/[id]/topology': 'Swarm structure and relationships'; 'swarm/[id]/communication': 'Inter-agent messages'; 'swarm/[id]/consensus': 'Decision points and outcomes'; } export declare class QueenMemorySystem extends EventEmitter { private memory; private logger; private objectiveCache; private agentIndex; constructor(memory: HierarchicalMemorySystem); /** * Store objective with full context */ storeObjective(objectiveId: string, objective: { description: string; requirements?: string[]; constraints?: string[]; expectedOutcome?: string; priority?: 'low' | 'medium' | 'high' | 'critical'; }): Promise<void>; /** * Store task _analysis with patterns */ storeTaskAnalysis(objectiveId: string, _analysis: { taskType: string; requiredCapabilities: string[]; suggestedAgents: string[]; estimatedComplexity: number; dependencies?: string[]; similarPatterns?: string[]; }): Promise<void>; /** * Store agent profile with capabilities */ storeAgentProfile(agentId: string, profile: { type: string; capabilities: string[]; status: 'idle' | 'working' | 'completed' | 'failed'; performance?: { tasksCompleted: number; successRate: number; avgExecutionTime: number; }; }): Promise<void>; /** * Store agent task assignment */ storeAgentTask(agentId: string, taskId: string, task: { objective: string; action: string; priority: number; dependencies?: string[]; deadline?: Date; }): Promise<void>; /** * Store ServiceNow artifact with full metadata */ storeArtifact(artifact: { type: 'widget' | 'flow' | 'script' | 'table' | 'application'; name: string; sysId?: string; content: any; dependencies?: string[]; deployment?: { instance: string; updateSet?: string; deployedAt: Date; }; }): Promise<void>; /** * Store deployment information */ storeDeployment(artifactName: string, deployment: { instance: string; updateSet?: string; deployedAt: Date; status: 'success' | 'failed' | 'pending'; errors?: string[]; }): Promise<void>; /** * Store successful pattern for learning */ storeSuccessfulPattern(pattern: { type: string; objective: string; approach: string; agents: string[]; duration: number; outcome: any; }): Promise<void>; /** * Store failure pattern for avoidance */ storeFailurePattern(pattern: { type: string; objective: string; approach: string; failureReason: string; lessons: string[]; }): Promise<void>; /** * Find similar objectives from history */ findSimilarObjectives(objective: string, limit?: number): Promise<any[]>; /** * Get successful patterns for a task type */ getSuccessfulPatterns(taskType: string): Promise<any[]>; /** * Get agent's complete memory */ getAgentMemory(agentId: string): Promise<HierarchicalMemoryEntry[]>; /** * Get swarm coordination data */ getSwarmData(swarmId: string): Promise<{ topology: any; communication: any[]; consensus: any[]; }>; /** * Store inter-agent communication */ storeAgentCommunication(fromAgent: string, toAgent: string, message: any, swarmId?: string): Promise<void>; /** * Get namespace statistics for monitoring */ getMemoryStats(): Promise<{ namespaces: Record<string, number>; totalEntries: number; patterns: number; artifacts: number; agents: number; }>; /** * Helper to get artifact memory structure */ private getArtifactMemoryStructure; /** * Clean up expired entries */ cleanup(): Promise<number>; } //# sourceMappingURL=queen-memory-system.d.ts.map