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

184 lines 5.01 kB
/** * Queen Agent Core with Enhanced 403 Error Handling * Master coordinator that analyzes objectives and spawns specialized agents * Works through Claude Code interface using TodoWrite for task coordination * Now with intelligent 403 error handling using Gap Analysis Engine */ import { EventEmitter } from 'eventemitter3'; import { TodoItem } from '../types/todo.types'; import { Agent, TaskAnalysis } from '../queen/types'; export interface QueenAgentConfig { memoryPath?: string; maxConcurrentAgents?: number; debugMode?: boolean; autoSpawn?: boolean; claudeCodeInterface?: boolean; mcpTools?: any; } export interface QueenObjective { id: string; description: string; priority?: 'low' | 'medium' | 'high' | 'critical'; constraints?: string[]; metadata?: Record<string, any>; } export interface TodoCoordination { objectiveId: string; todos: TodoItem[]; agentAssignments: Map<string, string>; dependencies: Map<string, string[]>; } export declare class QueenAgent extends EventEmitter { private memory; private parallelEngine; private config; private activeObjectives; private todoCoordinations; private activeAgents; private logger; constructor(config?: QueenAgentConfig); /** * Update MCP tools configuration (useful when tools become available later) */ updateMCPTools(mcpTools: any): void; /** * Analyze objective and create coordinated execution plan */ analyzeObjective(objective: string | QueenObjective): Promise<TaskAnalysis>; /** * Handle deployment error with intelligent 403 detection and resolution */ handleDeploymentError(error: any, context: { objectiveId: string; agentId?: string; operation: string; artifactType?: string; tableName?: string; }): Promise<boolean>; /** * Check if error is a 403 permission error */ private is403Error; /** * Update todos with permission fix steps */ private updateTodosWithPermissionFixes; /** * Spawn agents based on objective requirements with intelligent parallelization */ spawnAgents(objectiveId: string): Promise<Agent[]>; /** * 🚀 NEW: Spawn parallel agents based on opportunities */ private spawnParallelAgents; /** * Fallback to sequential agent spawning */ private spawnSequentialAgents; /** * Spawn a specialized agent with optional specialization */ private spawnSpecializedAgent; /** * Analyze objective to determine requirements */ private performObjectiveAnalysis; /** * Create todo coordination structure for Claude Code interface */ private createTodoCoordination; /** * Generate todos based on objective type */ private generateTodosForObjective; /** * Create widget-specific todos */ private createWidgetTodos; /** * Create portal page-specific todos */ private createPortalPageTodos; /** * Create flow-specific todos */ private createFlowTodos; /** * Create application-specific todos */ private createApplicationTodos; /** * Create script-specific todos */ private createScriptTodos; /** * Create integration-specific todos */ private createIntegrationTodos; /** * Create generic todos for unknown task types */ private createGenericTodos; /** * Analyze todo dependencies */ private analyzeTodoDependencies; /** * Assign todos to agent based on capabilities */ private assignTodosToAgent; /** * Check if agent can handle specific todo */ private canAgentHandleTodo; /** * Monitor agent progress through todo updates */ monitorProgress(objectiveId: string): Promise<{ overall: number; byAgent: Map<string, number>; blockingIssues: string[]; estimatedCompletion: Date; }>; /** * Make memory-driven decisions based on past patterns */ makeDecision(context: { objective: string; currentState: any; options: string[]; }): Promise<{ decision: string; confidence: number; reasoning: string; }>; /** * Setup event handlers for coordination */ private setupEventHandlers; /** * Check if more agents need to be spawned */ private checkAndSpawnAgents; /** * Handle coordination errors */ private handleCoordinationError; /** * Identify blocking issues from todos */ private identifyBlockingIssues; /** * Estimate completion time based on current progress */ private estimateCompletion; /** * Generate unique ID for entities */ private generateId; /** * Shutdown queen agent gracefully */ shutdown(): Promise<void>; } //# sourceMappingURL=queen-agent.d.ts.map