@framers/agentos 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +98 -0
- package/README.md +576 -0
- package/dist/api/AgentOS.d.ts +451 -0
- package/dist/api/AgentOS.d.ts.map +1 -0
- package/dist/api/AgentOS.js +1157 -0
- package/dist/api/AgentOS.js.map +1 -0
- package/dist/api/AgentOSOrchestrator.d.ts +157 -0
- package/dist/api/AgentOSOrchestrator.d.ts.map +1 -0
- package/dist/api/AgentOSOrchestrator.js +679 -0
- package/dist/api/AgentOSOrchestrator.js.map +1 -0
- package/dist/api/interfaces/IAgentOS.d.ts +138 -0
- package/dist/api/interfaces/IAgentOS.d.ts.map +1 -0
- package/dist/api/interfaces/IAgentOS.js +11 -0
- package/dist/api/interfaces/IAgentOS.js.map +1 -0
- package/dist/api/interfaces/IUnifiedAgent.d.ts +126 -0
- package/dist/api/interfaces/IUnifiedAgent.d.ts.map +1 -0
- package/dist/api/interfaces/IUnifiedAgent.js +3 -0
- package/dist/api/interfaces/IUnifiedAgent.js.map +1 -0
- package/dist/api/types/AgentOSInput.d.ts +114 -0
- package/dist/api/types/AgentOSInput.d.ts.map +1 -0
- package/dist/api/types/AgentOSInput.js +13 -0
- package/dist/api/types/AgentOSInput.js.map +1 -0
- package/dist/api/types/AgentOSResponse.d.ts +170 -0
- package/dist/api/types/AgentOSResponse.d.ts.map +1 -0
- package/dist/api/types/AgentOSResponse.js +25 -0
- package/dist/api/types/AgentOSResponse.js.map +1 -0
- package/dist/cognitive_substrate/GMI.d.ts +148 -0
- package/dist/cognitive_substrate/GMI.d.ts.map +1 -0
- package/dist/cognitive_substrate/GMI.js +1003 -0
- package/dist/cognitive_substrate/GMI.js.map +1 -0
- package/dist/cognitive_substrate/GMIManager.d.ts +98 -0
- package/dist/cognitive_substrate/GMIManager.d.ts.map +1 -0
- package/dist/cognitive_substrate/GMIManager.js +517 -0
- package/dist/cognitive_substrate/GMIManager.js.map +1 -0
- package/dist/cognitive_substrate/IGMI.d.ts +469 -0
- package/dist/cognitive_substrate/IGMI.d.ts.map +1 -0
- package/dist/cognitive_substrate/IGMI.js +111 -0
- package/dist/cognitive_substrate/IGMI.js.map +1 -0
- package/dist/cognitive_substrate/memory/IWorkingMemory.d.ts +139 -0
- package/dist/cognitive_substrate/memory/IWorkingMemory.d.ts.map +1 -0
- package/dist/cognitive_substrate/memory/IWorkingMemory.js +14 -0
- package/dist/cognitive_substrate/memory/IWorkingMemory.js.map +1 -0
- package/dist/cognitive_substrate/memory/InMemoryWorkingMemory.d.ts +143 -0
- package/dist/cognitive_substrate/memory/InMemoryWorkingMemory.d.ts.map +1 -0
- package/dist/cognitive_substrate/memory/InMemoryWorkingMemory.js +186 -0
- package/dist/cognitive_substrate/memory/InMemoryWorkingMemory.js.map +1 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayManager.d.ts +33 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayManager.d.ts.map +1 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayManager.js +138 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayManager.js.map +1 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayTypes.d.ts +32 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayTypes.d.ts.map +1 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayTypes.js +2 -0
- package/dist/cognitive_substrate/persona_overlays/PersonaOverlayTypes.js.map +1 -0
- package/dist/cognitive_substrate/personas/IPersonaDefinition.d.ts +336 -0
- package/dist/cognitive_substrate/personas/IPersonaDefinition.d.ts.map +1 -0
- package/dist/cognitive_substrate/personas/IPersonaDefinition.js +8 -0
- package/dist/cognitive_substrate/personas/IPersonaDefinition.js.map +1 -0
- package/dist/cognitive_substrate/personas/IPersonaLoader.d.ts +78 -0
- package/dist/cognitive_substrate/personas/IPersonaLoader.d.ts.map +1 -0
- package/dist/cognitive_substrate/personas/IPersonaLoader.js +9 -0
- package/dist/cognitive_substrate/personas/IPersonaLoader.js.map +1 -0
- package/dist/cognitive_substrate/personas/PersonaLoader.d.ts +60 -0
- package/dist/cognitive_substrate/personas/PersonaLoader.d.ts.map +1 -0
- package/dist/cognitive_substrate/personas/PersonaLoader.js +138 -0
- package/dist/cognitive_substrate/personas/PersonaLoader.js.map +1 -0
- package/dist/cognitive_substrate/personas/PersonaValidation.d.ts +139 -0
- package/dist/cognitive_substrate/personas/PersonaValidation.d.ts.map +1 -0
- package/dist/cognitive_substrate/personas/PersonaValidation.js +277 -0
- package/dist/cognitive_substrate/personas/PersonaValidation.js.map +1 -0
- package/dist/cognitive_substrate/personas/definitions/atlas_systems_architect.json +29 -0
- package/dist/cognitive_substrate/personas/definitions/default_assistant_persona.json +346 -0
- package/dist/cognitive_substrate/personas/definitions/default_free_assistant.json +13 -0
- package/dist/cognitive_substrate/personas/definitions/index.d.ts +14 -0
- package/dist/cognitive_substrate/personas/definitions/index.d.ts.map +1 -0
- package/dist/cognitive_substrate/personas/definitions/index.js +35 -0
- package/dist/cognitive_substrate/personas/definitions/index.js.map +1 -0
- package/dist/cognitive_substrate/personas/definitions/nerf_generalist.json +11 -0
- package/dist/cognitive_substrate/personas/definitions/v_researcher.json +11 -0
- package/dist/config/AgentOSConfig.d.ts +74 -0
- package/dist/config/AgentOSConfig.d.ts.map +1 -0
- package/dist/config/AgentOSConfig.js +399 -0
- package/dist/config/AgentOSConfig.js.map +1 -0
- package/dist/config/EmbeddingManagerConfiguration.d.ts +190 -0
- package/dist/config/EmbeddingManagerConfiguration.d.ts.map +1 -0
- package/dist/config/EmbeddingManagerConfiguration.js +16 -0
- package/dist/config/EmbeddingManagerConfiguration.js.map +1 -0
- package/dist/config/MemoryLifecycleManagerConfiguration.d.ts +165 -0
- package/dist/config/MemoryLifecycleManagerConfiguration.d.ts.map +1 -0
- package/dist/config/MemoryLifecycleManagerConfiguration.js +69 -0
- package/dist/config/MemoryLifecycleManagerConfiguration.js.map +1 -0
- package/dist/config/RetrievalAugmentorConfiguration.d.ts +98 -0
- package/dist/config/RetrievalAugmentorConfiguration.d.ts.map +1 -0
- package/dist/config/RetrievalAugmentorConfiguration.js +47 -0
- package/dist/config/RetrievalAugmentorConfiguration.js.map +1 -0
- package/dist/config/ToolOrchestratorConfig.d.ts +69 -0
- package/dist/config/ToolOrchestratorConfig.d.ts.map +1 -0
- package/dist/config/ToolOrchestratorConfig.js +11 -0
- package/dist/config/ToolOrchestratorConfig.js.map +1 -0
- package/dist/config/VectorStoreConfiguration.d.ts +223 -0
- package/dist/config/VectorStoreConfiguration.d.ts.map +1 -0
- package/dist/config/VectorStoreConfiguration.js +59 -0
- package/dist/config/VectorStoreConfiguration.js.map +1 -0
- package/dist/config/extension-secrets.json +38 -0
- package/dist/config/extensionSecrets.d.ts +13 -0
- package/dist/config/extensionSecrets.d.ts.map +1 -0
- package/dist/config/extensionSecrets.js +24 -0
- package/dist/config/extensionSecrets.js.map +1 -0
- package/dist/core/agency/AgencyMemoryManager.d.ts +300 -0
- package/dist/core/agency/AgencyMemoryManager.d.ts.map +1 -0
- package/dist/core/agency/AgencyMemoryManager.js +657 -0
- package/dist/core/agency/AgencyMemoryManager.js.map +1 -0
- package/dist/core/agency/AgencyRegistry.d.ts +100 -0
- package/dist/core/agency/AgencyRegistry.d.ts.map +1 -0
- package/dist/core/agency/AgencyRegistry.js +209 -0
- package/dist/core/agency/AgencyRegistry.js.map +1 -0
- package/dist/core/agency/AgencyTypes.d.ts +200 -0
- package/dist/core/agency/AgencyTypes.d.ts.map +1 -0
- package/dist/core/agency/AgencyTypes.js +7 -0
- package/dist/core/agency/AgencyTypes.js.map +1 -0
- package/dist/core/agency/AgentCommunicationBus.d.ts +150 -0
- package/dist/core/agency/AgentCommunicationBus.d.ts.map +1 -0
- package/dist/core/agency/AgentCommunicationBus.js +568 -0
- package/dist/core/agency/AgentCommunicationBus.js.map +1 -0
- package/dist/core/agency/IAgentCommunicationBus.d.ts +469 -0
- package/dist/core/agency/IAgentCommunicationBus.d.ts.map +1 -0
- package/dist/core/agency/IAgentCommunicationBus.js +40 -0
- package/dist/core/agency/IAgentCommunicationBus.js.map +1 -0
- package/dist/core/agency/index.d.ts +18 -0
- package/dist/core/agency/index.d.ts.map +1 -0
- package/dist/core/agency/index.js +18 -0
- package/dist/core/agency/index.js.map +1 -0
- package/dist/core/agents/AgentCore.d.ts +385 -0
- package/dist/core/agents/AgentCore.d.ts.map +1 -0
- package/dist/core/agents/AgentCore.js +527 -0
- package/dist/core/agents/AgentCore.js.map +1 -0
- package/dist/core/agents/AgentFactory.d.ts +123 -0
- package/dist/core/agents/AgentFactory.d.ts.map +1 -0
- package/dist/core/agents/AgentFactory.js +232 -0
- package/dist/core/agents/AgentFactory.js.map +1 -0
- package/dist/core/agents/AgentPoolAgent.d.ts +244 -0
- package/dist/core/agents/AgentPoolAgent.d.ts.map +1 -0
- package/dist/core/agents/AgentPoolAgent.js +697 -0
- package/dist/core/agents/AgentPoolAgent.js.map +1 -0
- package/dist/core/agents/AgentPoolConfig.d.ts +191 -0
- package/dist/core/agents/AgentPoolConfig.d.ts.map +1 -0
- package/dist/core/agents/AgentPoolConfig.js +58 -0
- package/dist/core/agents/AgentPoolConfig.js.map +1 -0
- package/dist/core/agents/IAgent.d.ts +226 -0
- package/dist/core/agents/IAgent.d.ts.map +1 -0
- package/dist/core/agents/IAgent.js +14 -0
- package/dist/core/agents/IAgent.js.map +1 -0
- package/dist/core/agents/IAgentFactory.d.ts +137 -0
- package/dist/core/agents/IAgentFactory.d.ts.map +1 -0
- package/dist/core/agents/IAgentFactory.js +13 -0
- package/dist/core/agents/IAgentFactory.js.map +1 -0
- package/dist/core/agents/tools/Tool.d.ts +17 -0
- package/dist/core/agents/tools/Tool.d.ts.map +1 -0
- package/dist/core/agents/tools/Tool.js +8 -0
- package/dist/core/agents/tools/Tool.js.map +1 -0
- package/dist/core/ai_utilities/HybridUtilityAI.d.ts +1 -0
- package/dist/core/ai_utilities/HybridUtilityAI.d.ts.map +1 -0
- package/dist/core/ai_utilities/HybridUtilityAI.js +2 -0
- package/dist/core/ai_utilities/HybridUtilityAI.js.map +1 -0
- package/dist/core/ai_utilities/IUtilityAI.d.ts +212 -0
- package/dist/core/ai_utilities/IUtilityAI.d.ts.map +1 -0
- package/dist/core/ai_utilities/IUtilityAI.js +11 -0
- package/dist/core/ai_utilities/IUtilityAI.js.map +1 -0
- package/dist/core/ai_utilities/LLMUtilityAI.d.ts +94 -0
- package/dist/core/ai_utilities/LLMUtilityAI.d.ts.map +1 -0
- package/dist/core/ai_utilities/LLMUtilityAI.js +434 -0
- package/dist/core/ai_utilities/LLMUtilityAI.js.map +1 -0
- package/dist/core/ai_utilities/StatisticalUtilityAI.d.ts +102 -0
- package/dist/core/ai_utilities/StatisticalUtilityAI.d.ts.map +1 -0
- package/dist/core/ai_utilities/StatisticalUtilityAI.js +617 -0
- package/dist/core/ai_utilities/StatisticalUtilityAI.js.map +1 -0
- package/dist/core/conversation/ConversationContext.d.ts +259 -0
- package/dist/core/conversation/ConversationContext.d.ts.map +1 -0
- package/dist/core/conversation/ConversationContext.js +450 -0
- package/dist/core/conversation/ConversationContext.js.map +1 -0
- package/dist/core/conversation/ConversationManager.d.ts +223 -0
- package/dist/core/conversation/ConversationManager.d.ts.map +1 -0
- package/dist/core/conversation/ConversationManager.js +558 -0
- package/dist/core/conversation/ConversationManager.js.map +1 -0
- package/dist/core/conversation/ConversationMessage.d.ts +184 -0
- package/dist/core/conversation/ConversationMessage.d.ts.map +1 -0
- package/dist/core/conversation/ConversationMessage.js +66 -0
- package/dist/core/conversation/ConversationMessage.js.map +1 -0
- package/dist/core/evaluation/Evaluator.d.ts +28 -0
- package/dist/core/evaluation/Evaluator.d.ts.map +1 -0
- package/dist/core/evaluation/Evaluator.js +490 -0
- package/dist/core/evaluation/Evaluator.js.map +1 -0
- package/dist/core/evaluation/IEvaluator.d.ts +309 -0
- package/dist/core/evaluation/IEvaluator.d.ts.map +1 -0
- package/dist/core/evaluation/IEvaluator.js +12 -0
- package/dist/core/evaluation/IEvaluator.js.map +1 -0
- package/dist/core/evaluation/LLMJudge.d.ts +105 -0
- package/dist/core/evaluation/LLMJudge.d.ts.map +1 -0
- package/dist/core/evaluation/LLMJudge.js +229 -0
- package/dist/core/evaluation/LLMJudge.js.map +1 -0
- package/dist/core/evaluation/index.d.ts +9 -0
- package/dist/core/evaluation/index.d.ts.map +1 -0
- package/dist/core/evaluation/index.js +9 -0
- package/dist/core/evaluation/index.js.map +1 -0
- package/dist/core/guardrails/IGuardrailService.d.ts +142 -0
- package/dist/core/guardrails/IGuardrailService.d.ts.map +1 -0
- package/dist/core/guardrails/IGuardrailService.js +24 -0
- package/dist/core/guardrails/IGuardrailService.js.map +1 -0
- package/dist/core/guardrails/guardrailDispatcher.d.ts +36 -0
- package/dist/core/guardrails/guardrailDispatcher.d.ts.map +1 -0
- package/dist/core/guardrails/guardrailDispatcher.js +240 -0
- package/dist/core/guardrails/guardrailDispatcher.js.map +1 -0
- package/dist/core/hitl/HumanInteractionManager.d.ts +146 -0
- package/dist/core/hitl/HumanInteractionManager.d.ts.map +1 -0
- package/dist/core/hitl/HumanInteractionManager.js +491 -0
- package/dist/core/hitl/HumanInteractionManager.js.map +1 -0
- package/dist/core/hitl/IHumanInteractionManager.d.ts +521 -0
- package/dist/core/hitl/IHumanInteractionManager.d.ts.map +1 -0
- package/dist/core/hitl/IHumanInteractionManager.js +33 -0
- package/dist/core/hitl/IHumanInteractionManager.js.map +1 -0
- package/dist/core/hitl/index.d.ts +17 -0
- package/dist/core/hitl/index.d.ts.map +1 -0
- package/dist/core/hitl/index.js +17 -0
- package/dist/core/hitl/index.js.map +1 -0
- package/dist/core/knowledge/IKnowledgeGraph.d.ts +351 -0
- package/dist/core/knowledge/IKnowledgeGraph.d.ts.map +1 -0
- package/dist/core/knowledge/IKnowledgeGraph.js +10 -0
- package/dist/core/knowledge/IKnowledgeGraph.js.map +1 -0
- package/dist/core/knowledge/KnowledgeGraph.d.ts +93 -0
- package/dist/core/knowledge/KnowledgeGraph.d.ts.map +1 -0
- package/dist/core/knowledge/KnowledgeGraph.js +601 -0
- package/dist/core/knowledge/KnowledgeGraph.js.map +1 -0
- package/dist/core/knowledge/index.d.ts +8 -0
- package/dist/core/knowledge/index.d.ts.map +1 -0
- package/dist/core/knowledge/index.js +8 -0
- package/dist/core/knowledge/index.js.map +1 -0
- package/dist/core/language/LanguageService.d.ts +77 -0
- package/dist/core/language/LanguageService.d.ts.map +1 -0
- package/dist/core/language/LanguageService.js +305 -0
- package/dist/core/language/LanguageService.js.map +1 -0
- package/dist/core/language/index.d.ts +6 -0
- package/dist/core/language/index.d.ts.map +1 -0
- package/dist/core/language/index.js +6 -0
- package/dist/core/language/index.js.map +1 -0
- package/dist/core/language/interfaces.d.ts +168 -0
- package/dist/core/language/interfaces.d.ts.map +1 -0
- package/dist/core/language/interfaces.js +37 -0
- package/dist/core/language/interfaces.js.map +1 -0
- package/dist/core/language/providers/DeepLTranslationProvider.d.ts +16 -0
- package/dist/core/language/providers/DeepLTranslationProvider.d.ts.map +1 -0
- package/dist/core/language/providers/DeepLTranslationProvider.js +28 -0
- package/dist/core/language/providers/DeepLTranslationProvider.js.map +1 -0
- package/dist/core/language/providers/OpenAITranslationProvider.d.ts +17 -0
- package/dist/core/language/providers/OpenAITranslationProvider.d.ts.map +1 -0
- package/dist/core/language/providers/OpenAITranslationProvider.js +34 -0
- package/dist/core/language/providers/OpenAITranslationProvider.js.map +1 -0
- package/dist/core/language/providers/WhisperDetectionProvider.d.ts +16 -0
- package/dist/core/language/providers/WhisperDetectionProvider.d.ts.map +1 -0
- package/dist/core/language/providers/WhisperDetectionProvider.js +15 -0
- package/dist/core/language/providers/WhisperDetectionProvider.js.map +1 -0
- package/dist/core/llm/IPromptEngine.d.ts +627 -0
- package/dist/core/llm/IPromptEngine.d.ts.map +1 -0
- package/dist/core/llm/IPromptEngine.js +81 -0
- package/dist/core/llm/IPromptEngine.js.map +1 -0
- package/dist/core/llm/PromptEngine.d.ts +108 -0
- package/dist/core/llm/PromptEngine.d.ts.map +1 -0
- package/dist/core/llm/PromptEngine.js +872 -0
- package/dist/core/llm/PromptEngine.js.map +1 -0
- package/dist/core/llm/providers/AIModelProviderManager.d.ts +74 -0
- package/dist/core/llm/providers/AIModelProviderManager.d.ts.map +1 -0
- package/dist/core/llm/providers/AIModelProviderManager.js +263 -0
- package/dist/core/llm/providers/AIModelProviderManager.js.map +1 -0
- package/dist/core/llm/providers/IProvider.d.ts +327 -0
- package/dist/core/llm/providers/IProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/IProvider.js +39 -0
- package/dist/core/llm/providers/IProvider.js.map +1 -0
- package/dist/core/llm/providers/errors/OllamaProviderError.d.ts +36 -0
- package/dist/core/llm/providers/errors/OllamaProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/OllamaProviderError.js +40 -0
- package/dist/core/llm/providers/errors/OllamaProviderError.js.map +1 -0
- package/dist/core/llm/providers/errors/OpenAIProviderError.d.ts +42 -0
- package/dist/core/llm/providers/errors/OpenAIProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/OpenAIProviderError.js +44 -0
- package/dist/core/llm/providers/errors/OpenAIProviderError.js.map +1 -0
- package/dist/core/llm/providers/errors/OpenRouterProviderError.d.ts +39 -0
- package/dist/core/llm/providers/errors/OpenRouterProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/OpenRouterProviderError.js +42 -0
- package/dist/core/llm/providers/errors/OpenRouterProviderError.js.map +1 -0
- package/dist/core/llm/providers/errors/ProviderError.d.ts +37 -0
- package/dist/core/llm/providers/errors/ProviderError.d.ts.map +1 -0
- package/dist/core/llm/providers/errors/ProviderError.js +36 -0
- package/dist/core/llm/providers/errors/ProviderError.js.map +1 -0
- package/dist/core/llm/providers/implementations/OllamaProvider.d.ts +80 -0
- package/dist/core/llm/providers/implementations/OllamaProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/OllamaProvider.js +473 -0
- package/dist/core/llm/providers/implementations/OllamaProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/OpenAIProvider.d.ts +160 -0
- package/dist/core/llm/providers/implementations/OpenAIProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/OpenAIProvider.js +672 -0
- package/dist/core/llm/providers/implementations/OpenAIProvider.js.map +1 -0
- package/dist/core/llm/providers/implementations/OpenRouterProvider.d.ts +51 -0
- package/dist/core/llm/providers/implementations/OpenRouterProvider.d.ts.map +1 -0
- package/dist/core/llm/providers/implementations/OpenRouterProvider.js +499 -0
- package/dist/core/llm/providers/implementations/OpenRouterProvider.js.map +1 -0
- package/dist/core/llm/routing/IModelRouter.d.ts +129 -0
- package/dist/core/llm/routing/IModelRouter.d.ts.map +1 -0
- package/dist/core/llm/routing/IModelRouter.js +14 -0
- package/dist/core/llm/routing/IModelRouter.js.map +1 -0
- package/dist/core/llm/routing/ModelRouter.d.ts +157 -0
- package/dist/core/llm/routing/ModelRouter.d.ts.map +1 -0
- package/dist/core/llm/routing/ModelRouter.js +190 -0
- package/dist/core/llm/routing/ModelRouter.js.map +1 -0
- package/dist/core/llm/streaming/StreamingBatcher.d.ts +54 -0
- package/dist/core/llm/streaming/StreamingBatcher.d.ts.map +1 -0
- package/dist/core/llm/streaming/StreamingBatcher.js +173 -0
- package/dist/core/llm/streaming/StreamingBatcher.js.map +1 -0
- package/dist/core/llm/streaming/StreamingReconstructor.d.ts +69 -0
- package/dist/core/llm/streaming/StreamingReconstructor.d.ts.map +1 -0
- package/dist/core/llm/streaming/StreamingReconstructor.js +102 -0
- package/dist/core/llm/streaming/StreamingReconstructor.js.map +1 -0
- package/dist/core/marketplace/IMarketplace.d.ts +500 -0
- package/dist/core/marketplace/IMarketplace.d.ts.map +1 -0
- package/dist/core/marketplace/IMarketplace.js +10 -0
- package/dist/core/marketplace/IMarketplace.js.map +1 -0
- package/dist/core/marketplace/Marketplace.d.ts +122 -0
- package/dist/core/marketplace/Marketplace.d.ts.map +1 -0
- package/dist/core/marketplace/Marketplace.js +591 -0
- package/dist/core/marketplace/Marketplace.js.map +1 -0
- package/dist/core/marketplace/index.d.ts +8 -0
- package/dist/core/marketplace/index.d.ts.map +1 -0
- package/dist/core/marketplace/index.js +8 -0
- package/dist/core/marketplace/index.js.map +1 -0
- package/dist/core/observability/ITracer.d.ts +317 -0
- package/dist/core/observability/ITracer.d.ts.map +1 -0
- package/dist/core/observability/ITracer.js +55 -0
- package/dist/core/observability/ITracer.js.map +1 -0
- package/dist/core/observability/Tracer.d.ts +76 -0
- package/dist/core/observability/Tracer.d.ts.map +1 -0
- package/dist/core/observability/Tracer.js +360 -0
- package/dist/core/observability/Tracer.js.map +1 -0
- package/dist/core/observability/index.d.ts +9 -0
- package/dist/core/observability/index.d.ts.map +1 -0
- package/dist/core/observability/index.js +8 -0
- package/dist/core/observability/index.js.map +1 -0
- package/dist/core/orchestration/AgentOrchestrator.d.ts +243 -0
- package/dist/core/orchestration/AgentOrchestrator.d.ts.map +1 -0
- package/dist/core/orchestration/AgentOrchestrator.js +648 -0
- package/dist/core/orchestration/AgentOrchestrator.js.map +1 -0
- package/dist/core/orchestration/IAgentOrchestrator.d.ts +44 -0
- package/dist/core/orchestration/IAgentOrchestrator.d.ts.map +1 -0
- package/dist/core/orchestration/IAgentOrchestrator.js +4 -0
- package/dist/core/orchestration/IAgentOrchestrator.js.map +1 -0
- package/dist/core/orchestration/helpers.d.ts +12 -0
- package/dist/core/orchestration/helpers.d.ts.map +1 -0
- package/dist/core/orchestration/helpers.js +36 -0
- package/dist/core/orchestration/helpers.js.map +1 -0
- package/dist/core/planning/IPlanningEngine.d.ts +524 -0
- package/dist/core/planning/IPlanningEngine.d.ts.map +1 -0
- package/dist/core/planning/IPlanningEngine.js +32 -0
- package/dist/core/planning/IPlanningEngine.js.map +1 -0
- package/dist/core/planning/PlanningEngine.d.ts +161 -0
- package/dist/core/planning/PlanningEngine.d.ts.map +1 -0
- package/dist/core/planning/PlanningEngine.js +783 -0
- package/dist/core/planning/PlanningEngine.js.map +1 -0
- package/dist/core/planning/index.d.ts +25 -0
- package/dist/core/planning/index.d.ts.map +1 -0
- package/dist/core/planning/index.js +25 -0
- package/dist/core/planning/index.js.map +1 -0
- package/dist/core/sandbox/CodeSandbox.d.ts +86 -0
- package/dist/core/sandbox/CodeSandbox.d.ts.map +1 -0
- package/dist/core/sandbox/CodeSandbox.js +475 -0
- package/dist/core/sandbox/CodeSandbox.js.map +1 -0
- package/dist/core/sandbox/ICodeSandbox.d.ts +249 -0
- package/dist/core/sandbox/ICodeSandbox.d.ts.map +1 -0
- package/dist/core/sandbox/ICodeSandbox.js +24 -0
- package/dist/core/sandbox/ICodeSandbox.js.map +1 -0
- package/dist/core/sandbox/index.d.ts +9 -0
- package/dist/core/sandbox/index.d.ts.map +1 -0
- package/dist/core/sandbox/index.js +8 -0
- package/dist/core/sandbox/index.js.map +1 -0
- package/dist/core/storage/IStorageAdapter.d.ts +483 -0
- package/dist/core/storage/IStorageAdapter.d.ts.map +1 -0
- package/dist/core/storage/IStorageAdapter.js +19 -0
- package/dist/core/storage/IStorageAdapter.js.map +1 -0
- package/dist/core/storage/InMemoryStorageAdapter.d.ts +192 -0
- package/dist/core/storage/InMemoryStorageAdapter.d.ts.map +1 -0
- package/dist/core/storage/InMemoryStorageAdapter.js +343 -0
- package/dist/core/storage/InMemoryStorageAdapter.js.map +1 -0
- package/dist/core/storage/SqlStorageAdapter.d.ts +262 -0
- package/dist/core/storage/SqlStorageAdapter.d.ts.map +1 -0
- package/dist/core/storage/SqlStorageAdapter.js +485 -0
- package/dist/core/storage/SqlStorageAdapter.js.map +1 -0
- package/dist/core/storage/index.d.ts +14 -0
- package/dist/core/storage/index.d.ts.map +1 -0
- package/dist/core/storage/index.js +14 -0
- package/dist/core/storage/index.js.map +1 -0
- package/dist/core/streaming/IStreamClient.d.ts +72 -0
- package/dist/core/streaming/IStreamClient.d.ts.map +1 -0
- package/dist/core/streaming/IStreamClient.js +12 -0
- package/dist/core/streaming/IStreamClient.js.map +1 -0
- package/dist/core/streaming/StreamingManager.d.ts +242 -0
- package/dist/core/streaming/StreamingManager.d.ts.map +1 -0
- package/dist/core/streaming/StreamingManager.js +282 -0
- package/dist/core/streaming/StreamingManager.js.map +1 -0
- package/dist/core/structured/IStructuredOutputManager.d.ts +701 -0
- package/dist/core/structured/IStructuredOutputManager.d.ts.map +1 -0
- package/dist/core/structured/IStructuredOutputManager.js +74 -0
- package/dist/core/structured/IStructuredOutputManager.js.map +1 -0
- package/dist/core/structured/StructuredOutputManager.d.ts +140 -0
- package/dist/core/structured/StructuredOutputManager.d.ts.map +1 -0
- package/dist/core/structured/StructuredOutputManager.js +1015 -0
- package/dist/core/structured/StructuredOutputManager.js.map +1 -0
- package/dist/core/structured/index.d.ts +34 -0
- package/dist/core/structured/index.d.ts.map +1 -0
- package/dist/core/structured/index.js +34 -0
- package/dist/core/structured/index.js.map +1 -0
- package/dist/core/tools/ITool.d.ts +228 -0
- package/dist/core/tools/ITool.d.ts.map +1 -0
- package/dist/core/tools/ITool.js +11 -0
- package/dist/core/tools/ITool.js.map +1 -0
- package/dist/core/tools/IToolOrchestrator.d.ts +131 -0
- package/dist/core/tools/IToolOrchestrator.d.ts.map +1 -0
- package/dist/core/tools/IToolOrchestrator.js +14 -0
- package/dist/core/tools/IToolOrchestrator.js.map +1 -0
- package/dist/core/tools/ToolExecutor.d.ts +143 -0
- package/dist/core/tools/ToolExecutor.d.ts.map +1 -0
- package/dist/core/tools/ToolExecutor.js +364 -0
- package/dist/core/tools/ToolExecutor.js.map +1 -0
- package/dist/core/tools/ToolOrchestrator.d.ts +142 -0
- package/dist/core/tools/ToolOrchestrator.d.ts.map +1 -0
- package/dist/core/tools/ToolOrchestrator.js +373 -0
- package/dist/core/tools/ToolOrchestrator.js.map +1 -0
- package/dist/core/tools/permissions/IToolPermissionManager.d.ts +195 -0
- package/dist/core/tools/permissions/IToolPermissionManager.d.ts.map +1 -0
- package/dist/core/tools/permissions/IToolPermissionManager.js +14 -0
- package/dist/core/tools/permissions/IToolPermissionManager.js.map +1 -0
- package/dist/core/tools/permissions/ToolPermissionManager.d.ts +203 -0
- package/dist/core/tools/permissions/ToolPermissionManager.d.ts.map +1 -0
- package/dist/core/tools/permissions/ToolPermissionManager.js +298 -0
- package/dist/core/tools/permissions/ToolPermissionManager.js.map +1 -0
- package/dist/core/ui/IUIComponent.d.ts +11 -0
- package/dist/core/ui/IUIComponent.d.ts.map +1 -0
- package/dist/core/ui/IUIComponent.js +2 -0
- package/dist/core/ui/IUIComponent.js.map +1 -0
- package/dist/core/usage/UsageLedger.d.ts +81 -0
- package/dist/core/usage/UsageLedger.d.ts.map +1 -0
- package/dist/core/usage/UsageLedger.js +135 -0
- package/dist/core/usage/UsageLedger.js.map +1 -0
- package/dist/core/workflows/IWorkflowEngine.d.ts +42 -0
- package/dist/core/workflows/IWorkflowEngine.d.ts.map +1 -0
- package/dist/core/workflows/IWorkflowEngine.js +2 -0
- package/dist/core/workflows/IWorkflowEngine.js.map +1 -0
- package/dist/core/workflows/WorkflowEngine.d.ts +28 -0
- package/dist/core/workflows/WorkflowEngine.d.ts.map +1 -0
- package/dist/core/workflows/WorkflowEngine.js +309 -0
- package/dist/core/workflows/WorkflowEngine.js.map +1 -0
- package/dist/core/workflows/WorkflowTypes.d.ts +180 -0
- package/dist/core/workflows/WorkflowTypes.d.ts.map +1 -0
- package/dist/core/workflows/WorkflowTypes.js +26 -0
- package/dist/core/workflows/WorkflowTypes.js.map +1 -0
- package/dist/core/workflows/runtime/WorkflowRuntime.d.ts +70 -0
- package/dist/core/workflows/runtime/WorkflowRuntime.d.ts.map +1 -0
- package/dist/core/workflows/runtime/WorkflowRuntime.js +566 -0
- package/dist/core/workflows/runtime/WorkflowRuntime.js.map +1 -0
- package/dist/core/workflows/storage/IWorkflowStore.d.ts +75 -0
- package/dist/core/workflows/storage/IWorkflowStore.d.ts.map +1 -0
- package/dist/core/workflows/storage/IWorkflowStore.js +2 -0
- package/dist/core/workflows/storage/IWorkflowStore.js.map +1 -0
- package/dist/core/workflows/storage/InMemoryWorkflowStore.d.ts +14 -0
- package/dist/core/workflows/storage/InMemoryWorkflowStore.d.ts.map +1 -0
- package/dist/core/workflows/storage/InMemoryWorkflowStore.js +130 -0
- package/dist/core/workflows/storage/InMemoryWorkflowStore.js.map +1 -0
- package/dist/extensions/ExtensionLoader.d.ts +119 -0
- package/dist/extensions/ExtensionLoader.d.ts.map +1 -0
- package/dist/extensions/ExtensionLoader.js +297 -0
- package/dist/extensions/ExtensionLoader.js.map +1 -0
- package/dist/extensions/ExtensionManager.d.ts +49 -0
- package/dist/extensions/ExtensionManager.d.ts.map +1 -0
- package/dist/extensions/ExtensionManager.js +197 -0
- package/dist/extensions/ExtensionManager.js.map +1 -0
- package/dist/extensions/ExtensionRegistry.d.ts +39 -0
- package/dist/extensions/ExtensionRegistry.d.ts.map +1 -0
- package/dist/extensions/ExtensionRegistry.js +103 -0
- package/dist/extensions/ExtensionRegistry.js.map +1 -0
- package/dist/extensions/MultiRegistryLoader.d.ts +61 -0
- package/dist/extensions/MultiRegistryLoader.d.ts.map +1 -0
- package/dist/extensions/MultiRegistryLoader.js +169 -0
- package/dist/extensions/MultiRegistryLoader.js.map +1 -0
- package/dist/extensions/RegistryConfig.d.ts +86 -0
- package/dist/extensions/RegistryConfig.d.ts.map +1 -0
- package/dist/extensions/RegistryConfig.js +99 -0
- package/dist/extensions/RegistryConfig.js.map +1 -0
- package/dist/extensions/events.d.ts +19 -0
- package/dist/extensions/events.d.ts.map +1 -0
- package/dist/extensions/events.js +2 -0
- package/dist/extensions/events.js.map +1 -0
- package/dist/extensions/index.d.ts +9 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +9 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/manifest.d.ts +52 -0
- package/dist/extensions/manifest.d.ts.map +1 -0
- package/dist/extensions/manifest.js +2 -0
- package/dist/extensions/manifest.js.map +1 -0
- package/dist/extensions/types.d.ts +294 -0
- package/dist/extensions/types.d.ts.map +1 -0
- package/dist/extensions/types.js +12 -0
- package/dist/extensions/types.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/ILogger.d.ts +8 -0
- package/dist/logging/ILogger.d.ts.map +1 -0
- package/dist/logging/ILogger.js +2 -0
- package/dist/logging/ILogger.js.map +1 -0
- package/dist/logging/PinoLogger.d.ts +12 -0
- package/dist/logging/PinoLogger.d.ts.map +1 -0
- package/dist/logging/PinoLogger.js +22 -0
- package/dist/logging/PinoLogger.js.map +1 -0
- package/dist/logging/loggerFactory.d.ts +6 -0
- package/dist/logging/loggerFactory.d.ts.map +1 -0
- package/dist/logging/loggerFactory.js +14 -0
- package/dist/logging/loggerFactory.js.map +1 -0
- package/dist/rag/EmbeddingManager.d.ts +81 -0
- package/dist/rag/EmbeddingManager.d.ts.map +1 -0
- package/dist/rag/EmbeddingManager.js +412 -0
- package/dist/rag/EmbeddingManager.js.map +1 -0
- package/dist/rag/IEmbeddingManager.d.ts +277 -0
- package/dist/rag/IEmbeddingManager.d.ts.map +1 -0
- package/dist/rag/IEmbeddingManager.js +19 -0
- package/dist/rag/IEmbeddingManager.js.map +1 -0
- package/dist/rag/IRetrievalAugmentor.d.ts +208 -0
- package/dist/rag/IRetrievalAugmentor.d.ts.map +1 -0
- package/dist/rag/IRetrievalAugmentor.js +21 -0
- package/dist/rag/IRetrievalAugmentor.js.map +1 -0
- package/dist/rag/IVectorStore.d.ts +351 -0
- package/dist/rag/IVectorStore.d.ts.map +1 -0
- package/dist/rag/IVectorStore.js +15 -0
- package/dist/rag/IVectorStore.js.map +1 -0
- package/dist/rag/IVectorStoreManager.d.ts +121 -0
- package/dist/rag/IVectorStoreManager.d.ts.map +1 -0
- package/dist/rag/IVectorStoreManager.js +13 -0
- package/dist/rag/IVectorStoreManager.js.map +1 -0
- package/dist/rag/RetrievalAugmentor.d.ts +99 -0
- package/dist/rag/RetrievalAugmentor.d.ts.map +1 -0
- package/dist/rag/RetrievalAugmentor.js +674 -0
- package/dist/rag/RetrievalAugmentor.js.map +1 -0
- package/dist/rag/VectorStoreManager.d.ts +90 -0
- package/dist/rag/VectorStoreManager.d.ts.map +1 -0
- package/dist/rag/VectorStoreManager.js +283 -0
- package/dist/rag/VectorStoreManager.js.map +1 -0
- package/dist/rag/implementations/index.d.ts +9 -0
- package/dist/rag/implementations/index.d.ts.map +1 -0
- package/dist/rag/implementations/index.js +9 -0
- package/dist/rag/implementations/index.js.map +1 -0
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.d.ts +132 -0
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.d.ts.map +1 -0
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.js +539 -0
- package/dist/rag/implementations/vector_stores/InMemoryVectorStore.js.map +1 -0
- package/dist/rag/implementations/vector_stores/SqlVectorStore.d.ts +265 -0
- package/dist/rag/implementations/vector_stores/SqlVectorStore.d.ts.map +1 -0
- package/dist/rag/implementations/vector_stores/SqlVectorStore.js +755 -0
- package/dist/rag/implementations/vector_stores/SqlVectorStore.js.map +1 -0
- package/dist/rag/implementations/vector_stores/index.d.ts +10 -0
- package/dist/rag/implementations/vector_stores/index.d.ts.map +1 -0
- package/dist/rag/implementations/vector_stores/index.js +12 -0
- package/dist/rag/implementations/vector_stores/index.js.map +1 -0
- package/dist/rag/index.d.ts +95 -0
- package/dist/rag/index.d.ts.map +1 -0
- package/dist/rag/index.js +97 -0
- package/dist/rag/index.js.map +1 -0
- package/dist/services/user_auth/AuthService.d.ts +13 -0
- package/dist/services/user_auth/AuthService.d.ts.map +1 -0
- package/dist/services/user_auth/AuthService.js +24 -0
- package/dist/services/user_auth/AuthService.js.map +1 -0
- package/dist/services/user_auth/SubscriptionService.d.ts +14 -0
- package/dist/services/user_auth/SubscriptionService.d.ts.map +1 -0
- package/dist/services/user_auth/SubscriptionService.js +34 -0
- package/dist/services/user_auth/SubscriptionService.js.map +1 -0
- package/dist/services/user_auth/types.d.ts +30 -0
- package/dist/services/user_auth/types.d.ts.map +1 -0
- package/dist/services/user_auth/types.js +2 -0
- package/dist/services/user_auth/types.js.map +1 -0
- package/dist/stubs/prismaClient.d.ts +35 -0
- package/dist/stubs/prismaClient.d.ts.map +1 -0
- package/dist/stubs/prismaClient.js +47 -0
- package/dist/stubs/prismaClient.js.map +1 -0
- package/dist/types/rateLimitTypes.d.ts +70 -0
- package/dist/types/rateLimitTypes.d.ts.map +1 -0
- package/dist/types/rateLimitTypes.js +55 -0
- package/dist/types/rateLimitTypes.js.map +1 -0
- package/dist/utils/errors.d.ts +80 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +201 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/uuid.d.ts +11 -0
- package/dist/utils/uuid.d.ts.map +1 -0
- package/dist/utils/uuid.js +64 -0
- package/dist/utils/uuid.js.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Implements the `IAgentFactory` interface, providing a robust
|
|
3
|
+
* mechanism for creating and managing agent instances within AgentOS.
|
|
4
|
+
* This factory is responsible for:
|
|
5
|
+
* - Loading and storing agent configurations (`AgentConfig`).
|
|
6
|
+
* - Mapping agent type identifiers (from `AgentConfig.type`) to their corresponding
|
|
7
|
+
* agent class constructors (`AgentClassConstructor`).
|
|
8
|
+
* - Instantiating agents by their unique IDs, ensuring all necessary dependencies
|
|
9
|
+
* (like `IPromptEngine`, `AIModelProviderManager`, `IUtilityAI`, and the `IAgentFactory` itself)
|
|
10
|
+
* are correctly injected.
|
|
11
|
+
* - Handling the initialization lifecycle of newly created agents.
|
|
12
|
+
* - Allowing dynamic registration of new agent types.
|
|
13
|
+
*
|
|
14
|
+
* This centralized approach to agent creation promotes modularity, testability,
|
|
15
|
+
* and simplifies the process of extending the system with new agent types.
|
|
16
|
+
* @module backend/agentos/core/agents/AgentFactory
|
|
17
|
+
*/
|
|
18
|
+
import { IAgentFactory, AgentDependencies, AgentClassConstructor } from './IAgentFactory';
|
|
19
|
+
import { IAgent } from './IAgent';
|
|
20
|
+
import { AgentConfig } from './AgentCore';
|
|
21
|
+
/**
|
|
22
|
+
* Custom error class for issues specific to agent instantiation or configuration
|
|
23
|
+
* within the `AgentFactory`. This helps in distinguishing factory-related errors
|
|
24
|
+
* from other system errors.
|
|
25
|
+
* @class AgentFactoryError
|
|
26
|
+
* @extends {Error}
|
|
27
|
+
*/
|
|
28
|
+
export declare class AgentFactoryError extends Error {
|
|
29
|
+
/**
|
|
30
|
+
* A specific error code related to AgentFactory operations.
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
readonly code: string;
|
|
34
|
+
/**
|
|
35
|
+
* The ID of the agent involved in the error, if applicable.
|
|
36
|
+
* @type {string | undefined}
|
|
37
|
+
* @optional
|
|
38
|
+
*/
|
|
39
|
+
readonly agentId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The underlying error that caused this factory error, if any.
|
|
42
|
+
* @type {Error | undefined}
|
|
43
|
+
* @optional
|
|
44
|
+
*/
|
|
45
|
+
readonly underlyingError?: Error;
|
|
46
|
+
/**
|
|
47
|
+
* Creates an instance of `AgentFactoryError`.
|
|
48
|
+
* @param {string} message - The human-readable error message.
|
|
49
|
+
* @param {string} code - A unique code for the error type (e.g., 'CONFIG_NOT_FOUND', 'CLASS_NOT_REGISTERED', 'INSTANTIATION_FAILED').
|
|
50
|
+
* @param {string} [agentId] - Optional. The ID of the agent associated with this error.
|
|
51
|
+
* @param {Error} [underlyingError] - Optional. The original error that was caught and wrapped.
|
|
52
|
+
*/
|
|
53
|
+
constructor(message: string, code: string, agentId?: string, underlyingError?: Error);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A concrete implementation of `IAgentFactory`.
|
|
57
|
+
* This class is responsible for instantiating `IAgent` implementations based on
|
|
58
|
+
* loaded `AgentConfig` data and a map of registered agent classes. It ensures
|
|
59
|
+
* that agents are created with all their required dependencies.
|
|
60
|
+
*
|
|
61
|
+
* @class AgentFactory
|
|
62
|
+
* @implements {IAgentFactory}
|
|
63
|
+
*/
|
|
64
|
+
export declare class AgentFactory implements IAgentFactory {
|
|
65
|
+
/**
|
|
66
|
+
* Stores agent configurations, keyed by their unique agent ID.
|
|
67
|
+
* @private
|
|
68
|
+
* @type {Record<string, AgentConfig>}
|
|
69
|
+
*/
|
|
70
|
+
private agentConfigs;
|
|
71
|
+
/**
|
|
72
|
+
* Maps agent type identifiers (strings) to their corresponding class constructors.
|
|
73
|
+
* @private
|
|
74
|
+
* @type {Record<string, AgentClassConstructor<any>>}
|
|
75
|
+
*/
|
|
76
|
+
private agentClassMap;
|
|
77
|
+
/**
|
|
78
|
+
* Flag indicating whether the factory has been successfully initialized.
|
|
79
|
+
* @private
|
|
80
|
+
* @type {boolean}
|
|
81
|
+
*/
|
|
82
|
+
private isInitialized;
|
|
83
|
+
/**
|
|
84
|
+
* Constructs an `AgentFactory`.
|
|
85
|
+
* Initialization (loading configs and classes) is performed via the `initialize` method.
|
|
86
|
+
*/
|
|
87
|
+
constructor();
|
|
88
|
+
/**
|
|
89
|
+
* Ensures that the factory has been initialized before any operational methods are called.
|
|
90
|
+
* @private
|
|
91
|
+
* @throws {AgentFactoryError} If the factory is not initialized.
|
|
92
|
+
*/
|
|
93
|
+
private ensureInitialized;
|
|
94
|
+
/**
|
|
95
|
+
* @inheritdoc
|
|
96
|
+
* Initializes the `AgentFactory` by loading agent configurations and mapping agent types
|
|
97
|
+
* to their respective class constructors.
|
|
98
|
+
* @throws {AgentFactoryError} If `agentConfigs` or `agentClassMap` is null/undefined.
|
|
99
|
+
*/
|
|
100
|
+
initialize(agentConfigs: Record<string, AgentConfig>, agentClassMap: Record<string, AgentClassConstructor<any>>): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* @inheritdoc
|
|
103
|
+
* Dynamically registers an agent type and its constructor with the factory.
|
|
104
|
+
* This allows for adding new agent implementations at runtime or via a plugin system.
|
|
105
|
+
* @throws {AgentFactoryError} If `agentType` or `constructor` is invalid, or if an agent type is already registered and overwrite is not intended.
|
|
106
|
+
*/
|
|
107
|
+
registerAgentClass(agentType: string, constructor: AgentClassConstructor<any>): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* @inheritdoc
|
|
110
|
+
* Retrieves (and typically creates and initializes) an agent instance by its ID.
|
|
111
|
+
* It resolves the agent's primary LLM provider using the `AIModelProviderManager` from `dependencies`.
|
|
112
|
+
* @throws {AgentFactoryError} If critical errors occur during instantiation, such as missing configuration,
|
|
113
|
+
* unregistered class, or failure to resolve the LLM provider.
|
|
114
|
+
*/
|
|
115
|
+
getAgent(agentId: string, dependencies: AgentDependencies): Promise<IAgent | undefined>;
|
|
116
|
+
/**
|
|
117
|
+
* @inheritdoc
|
|
118
|
+
* Lists all available agent configurations known to the factory.
|
|
119
|
+
* Returns deep copies of the configurations to prevent external modification.
|
|
120
|
+
*/
|
|
121
|
+
listAvailableAgentConfigs(): Promise<Readonly<AgentConfig[]>>;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=AgentFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentFactory.d.ts","sourceRoot":"","sources":["../../../src/core/agents/AgentFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAa,MAAM,aAAa,CAAC;AAErD;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C;;;OAGG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjC;;;;OAIG;IACH,SAAgB,eAAe,CAAC,EAAE,KAAK,CAAC;IAExC;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,KAAK;CAYrF;AAED;;;;;;;;GAQG;AACH,qBAAa,YAAa,YAAW,aAAa;IAChD;;;;OAIG;IACH,OAAO,CAAC,YAAY,CAAmC;IAEvD;;;;OAIG;IACH,OAAO,CAAC,aAAa,CAAkD;IAEvE;;;;OAIG;IACH,OAAO,CAAC,aAAa,CAAkB;IAEvC;;;OAGG;;IAKH;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IASzB;;;;;OAKG;IACU,UAAU,CACrB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACzC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC,GACxD,OAAO,CAAC,IAAI,CAAC;IA8BhB;;;;;OAKG;IACU,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,qBAAqB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB1G;;;;;;OAMG;IACU,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAkGpG;;;;OAIG;IACU,yBAAyB,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;CAkB3E"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Implements the `IAgentFactory` interface, providing a robust
|
|
3
|
+
* mechanism for creating and managing agent instances within AgentOS.
|
|
4
|
+
* This factory is responsible for:
|
|
5
|
+
* - Loading and storing agent configurations (`AgentConfig`).
|
|
6
|
+
* - Mapping agent type identifiers (from `AgentConfig.type`) to their corresponding
|
|
7
|
+
* agent class constructors (`AgentClassConstructor`).
|
|
8
|
+
* - Instantiating agents by their unique IDs, ensuring all necessary dependencies
|
|
9
|
+
* (like `IPromptEngine`, `AIModelProviderManager`, `IUtilityAI`, and the `IAgentFactory` itself)
|
|
10
|
+
* are correctly injected.
|
|
11
|
+
* - Handling the initialization lifecycle of newly created agents.
|
|
12
|
+
* - Allowing dynamic registration of new agent types.
|
|
13
|
+
*
|
|
14
|
+
* This centralized approach to agent creation promotes modularity, testability,
|
|
15
|
+
* and simplifies the process of extending the system with new agent types.
|
|
16
|
+
* @module backend/agentos/core/agents/AgentFactory
|
|
17
|
+
*/
|
|
18
|
+
import { AgentType } from './AgentCore.js'; // AgentConfig and AgentType
|
|
19
|
+
/**
|
|
20
|
+
* Custom error class for issues specific to agent instantiation or configuration
|
|
21
|
+
* within the `AgentFactory`. This helps in distinguishing factory-related errors
|
|
22
|
+
* from other system errors.
|
|
23
|
+
* @class AgentFactoryError
|
|
24
|
+
* @extends {Error}
|
|
25
|
+
*/
|
|
26
|
+
export class AgentFactoryError extends Error {
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of `AgentFactoryError`.
|
|
29
|
+
* @param {string} message - The human-readable error message.
|
|
30
|
+
* @param {string} code - A unique code for the error type (e.g., 'CONFIG_NOT_FOUND', 'CLASS_NOT_REGISTERED', 'INSTANTIATION_FAILED').
|
|
31
|
+
* @param {string} [agentId] - Optional. The ID of the agent associated with this error.
|
|
32
|
+
* @param {Error} [underlyingError] - Optional. The original error that was caught and wrapped.
|
|
33
|
+
*/
|
|
34
|
+
constructor(message, code, agentId, underlyingError) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.name = "AgentFactoryError";
|
|
37
|
+
this.code = code;
|
|
38
|
+
this.agentId = agentId;
|
|
39
|
+
this.underlyingError = underlyingError;
|
|
40
|
+
if (underlyingError && underlyingError.stack) {
|
|
41
|
+
this.stack = `${this.message}\nCaused by: ${underlyingError.stack}`;
|
|
42
|
+
}
|
|
43
|
+
Object.setPrototypeOf(this, AgentFactoryError.prototype);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A concrete implementation of `IAgentFactory`.
|
|
48
|
+
* This class is responsible for instantiating `IAgent` implementations based on
|
|
49
|
+
* loaded `AgentConfig` data and a map of registered agent classes. It ensures
|
|
50
|
+
* that agents are created with all their required dependencies.
|
|
51
|
+
*
|
|
52
|
+
* @class AgentFactory
|
|
53
|
+
* @implements {IAgentFactory}
|
|
54
|
+
*/
|
|
55
|
+
export class AgentFactory {
|
|
56
|
+
/**
|
|
57
|
+
* Constructs an `AgentFactory`.
|
|
58
|
+
* Initialization (loading configs and classes) is performed via the `initialize` method.
|
|
59
|
+
*/
|
|
60
|
+
constructor() {
|
|
61
|
+
/**
|
|
62
|
+
* Stores agent configurations, keyed by their unique agent ID.
|
|
63
|
+
* @private
|
|
64
|
+
* @type {Record<string, AgentConfig>}
|
|
65
|
+
*/
|
|
66
|
+
this.agentConfigs = {};
|
|
67
|
+
/**
|
|
68
|
+
* Maps agent type identifiers (strings) to their corresponding class constructors.
|
|
69
|
+
* @private
|
|
70
|
+
* @type {Record<string, AgentClassConstructor<any>>}
|
|
71
|
+
*/
|
|
72
|
+
this.agentClassMap = {};
|
|
73
|
+
/**
|
|
74
|
+
* Flag indicating whether the factory has been successfully initialized.
|
|
75
|
+
* @private
|
|
76
|
+
* @type {boolean}
|
|
77
|
+
*/
|
|
78
|
+
this.isInitialized = false;
|
|
79
|
+
// console.log("AgentFactory instance created. Awaiting initialization.");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Ensures that the factory has been initialized before any operational methods are called.
|
|
83
|
+
* @private
|
|
84
|
+
* @throws {AgentFactoryError} If the factory is not initialized.
|
|
85
|
+
*/
|
|
86
|
+
ensureInitialized() {
|
|
87
|
+
if (!this.isInitialized) {
|
|
88
|
+
throw new AgentFactoryError("AgentFactory is not initialized. Call initialize() with agent configurations and class map first.", 'FACTORY_NOT_INITIALIZED');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* @inheritdoc
|
|
93
|
+
* Initializes the `AgentFactory` by loading agent configurations and mapping agent types
|
|
94
|
+
* to their respective class constructors.
|
|
95
|
+
* @throws {AgentFactoryError} If `agentConfigs` or `agentClassMap` is null/undefined.
|
|
96
|
+
*/
|
|
97
|
+
async initialize(agentConfigs, agentClassMap) {
|
|
98
|
+
if (this.isInitialized) {
|
|
99
|
+
console.warn("AgentFactory is already initialized. Re-initializing will overwrite existing configurations and class mappings.");
|
|
100
|
+
// Resetting state for re-initialization
|
|
101
|
+
this.agentConfigs = {};
|
|
102
|
+
this.agentClassMap = {};
|
|
103
|
+
}
|
|
104
|
+
if (!agentConfigs) {
|
|
105
|
+
throw new AgentFactoryError("Agent configurations (agentConfigs) must be provided for initialization.", 'INIT_NO_CONFIGS');
|
|
106
|
+
}
|
|
107
|
+
if (!agentClassMap) {
|
|
108
|
+
throw new AgentFactoryError("Agent class map (agentClassMap) must be provided for initialization.", 'INIT_NO_CLASSMAP');
|
|
109
|
+
}
|
|
110
|
+
// Store copies to prevent external modification of the provided objects.
|
|
111
|
+
this.agentConfigs = { ...agentConfigs };
|
|
112
|
+
this.agentClassMap = { ...agentClassMap };
|
|
113
|
+
this.isInitialized = true;
|
|
114
|
+
const configCount = Object.keys(this.agentConfigs).length;
|
|
115
|
+
const classCount = Object.keys(this.agentClassMap).length;
|
|
116
|
+
if (configCount > 0 || classCount > 0) {
|
|
117
|
+
// console.log(`AgentFactory initialized successfully with ${configCount} agent configurations and ${classCount} registered agent classes.`);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
console.warn("AgentFactory initialized, but no agent configurations or agent classes were provided. The factory may not be able to create agents.");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @inheritdoc
|
|
125
|
+
* Dynamically registers an agent type and its constructor with the factory.
|
|
126
|
+
* This allows for adding new agent implementations at runtime or via a plugin system.
|
|
127
|
+
* @throws {AgentFactoryError} If `agentType` or `constructor` is invalid, or if an agent type is already registered and overwrite is not intended.
|
|
128
|
+
*/
|
|
129
|
+
async registerAgentClass(agentType, constructor) {
|
|
130
|
+
this.ensureInitialized();
|
|
131
|
+
if (!agentType || typeof agentType !== 'string' || agentType.trim() === '') {
|
|
132
|
+
throw new AgentFactoryError("Invalid agentType: Must be a non-empty string.", 'REGISTER_INVALID_AGENT_TYPE');
|
|
133
|
+
}
|
|
134
|
+
if (!constructor || typeof constructor !== 'function') {
|
|
135
|
+
throw new AgentFactoryError(`Invalid constructor provided for agentType '${agentType}'. Must be a class constructor.`, 'REGISTER_INVALID_CONSTRUCTOR', agentType);
|
|
136
|
+
}
|
|
137
|
+
if (this.agentClassMap[agentType]) {
|
|
138
|
+
console.warn(`AgentFactory: Agent type '${agentType}' is already registered. The existing constructor will be overwritten.`);
|
|
139
|
+
}
|
|
140
|
+
this.agentClassMap[agentType] = constructor;
|
|
141
|
+
// console.log(`AgentFactory: Agent type '${agentType}' registered successfully.`);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @inheritdoc
|
|
145
|
+
* Retrieves (and typically creates and initializes) an agent instance by its ID.
|
|
146
|
+
* It resolves the agent's primary LLM provider using the `AIModelProviderManager` from `dependencies`.
|
|
147
|
+
* @throws {AgentFactoryError} If critical errors occur during instantiation, such as missing configuration,
|
|
148
|
+
* unregistered class, or failure to resolve the LLM provider.
|
|
149
|
+
*/
|
|
150
|
+
async getAgent(agentId, dependencies) {
|
|
151
|
+
this.ensureInitialized();
|
|
152
|
+
if (!agentId) {
|
|
153
|
+
throw new AgentFactoryError("agentId must be provided to getAgent.", 'GET_AGENT_NO_ID');
|
|
154
|
+
}
|
|
155
|
+
if (!dependencies || !dependencies.promptEngine || !dependencies.providerManager) {
|
|
156
|
+
throw new AgentFactoryError("Missing critical dependencies (promptEngine, providerManager) required to create agent.", 'GET_AGENT_MISSING_DEPS', agentId);
|
|
157
|
+
}
|
|
158
|
+
// Destructure all dependencies for clarity
|
|
159
|
+
const { promptEngine, providerManager, utilityAI, agentFactory: selfFactory } = dependencies;
|
|
160
|
+
const config = this.agentConfigs[agentId];
|
|
161
|
+
if (!config) {
|
|
162
|
+
console.warn(`AgentFactory: No AgentConfig found for agentId '${agentId}'. Cannot create agent.`);
|
|
163
|
+
return undefined; // Gracefully return undefined if config not found
|
|
164
|
+
}
|
|
165
|
+
// Determine the agent's primary LLM provider using modelTargetInfo from its config
|
|
166
|
+
const providerIdToUse = config.modelTargetInfo?.providerId;
|
|
167
|
+
if (!providerIdToUse) {
|
|
168
|
+
throw new AgentFactoryError(`AgentConfig for '${agentId}' is missing 'modelTargetInfo.providerId'. Cannot determine primary LLM provider.`, 'GET_AGENT_NO_PROVIDER_ID', agentId);
|
|
169
|
+
}
|
|
170
|
+
const agentPrimaryProvider = providerManager.getProvider(providerIdToUse);
|
|
171
|
+
if (!agentPrimaryProvider) {
|
|
172
|
+
throw new AgentFactoryError(`Could not resolve primary LLM provider '${providerIdToUse}' for agent '${agentId}' using the provided AIModelProviderManager. Ensure the provider is configured and initialized in the manager.`, 'GET_AGENT_PROVIDER_RESOLUTION_FAILED', agentId);
|
|
173
|
+
}
|
|
174
|
+
// Determine the AgentClass constructor to use.
|
|
175
|
+
// `config.type` (e.g., AgentType.POOL) is the key for agentClassMap.
|
|
176
|
+
const agentTypeKey = config.type || AgentType.STANDARD; // Default to STANDARD if type not specified
|
|
177
|
+
const AgentClass = this.agentClassMap[agentTypeKey];
|
|
178
|
+
if (!AgentClass) {
|
|
179
|
+
throw new AgentFactoryError(`No implementing class registered for agent type '${agentTypeKey}' (referenced by agentId '${agentId}'). Agent cannot be created. Ensure the class is registered with the factory using registerAgentClass(). Known types: [${Object.keys(this.agentClassMap).join(', ')}].`, 'GET_AGENT_CLASS_NOT_REGISTERED', agentId);
|
|
180
|
+
}
|
|
181
|
+
let agentInstance;
|
|
182
|
+
try {
|
|
183
|
+
// Instantiate the agent, passing all resolved dependencies.
|
|
184
|
+
// Note: `selfFactory` (which is `dependencies.agentFactory`) is passed here.
|
|
185
|
+
agentInstance = new AgentClass(config, promptEngine, agentPrimaryProvider, utilityAI, selfFactory);
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
console.error(`AgentFactory: Error during instantiation of agent '${agentId}' (type '${agentTypeKey}'): ${error.message}`, error);
|
|
189
|
+
throw new AgentFactoryError(`Failed to instantiate agent '${agentId}' of type '${agentTypeKey}'. Constructor threw an error: ${error.message}`, 'GET_AGENT_CONSTRUCTION_FAILED', agentId, error);
|
|
190
|
+
}
|
|
191
|
+
// Give the agent a chance to capture the dependency bundle if it supports it.
|
|
192
|
+
if (typeof agentInstance.setAgentDependencies === 'function') {
|
|
193
|
+
try {
|
|
194
|
+
agentInstance.setAgentDependencies(dependencies);
|
|
195
|
+
}
|
|
196
|
+
catch (depError) {
|
|
197
|
+
console.warn(`AgentFactory: Agent '${agentId}' threw while receiving dependencies: ${depError.message}`, depError);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Call the agent's own initialize method, if it exists and is a function.
|
|
201
|
+
// This allows the agent to perform any specific asynchronous setup post-construction.
|
|
202
|
+
if (typeof agentInstance.initialize === 'function') {
|
|
203
|
+
try {
|
|
204
|
+
await agentInstance.initialize();
|
|
205
|
+
}
|
|
206
|
+
catch (initError) {
|
|
207
|
+
console.error(`AgentFactory: Error during agent.initialize() for '${agentId}': ${initError.message}`, initError);
|
|
208
|
+
throw new AgentFactoryError(`Agent '${agentId}' was instantiated but failed during its own initialize() method: ${initError.message}`, 'GET_AGENT_INITIALIZATION_FAILED', agentId, initError);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
// console.log(`AgentFactory: Successfully created and initialized agent '${agentId}' of type '${agentTypeKey}'.`);
|
|
212
|
+
return agentInstance;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* @inheritdoc
|
|
216
|
+
* Lists all available agent configurations known to the factory.
|
|
217
|
+
* Returns deep copies of the configurations to prevent external modification.
|
|
218
|
+
*/
|
|
219
|
+
async listAvailableAgentConfigs() {
|
|
220
|
+
this.ensureInitialized();
|
|
221
|
+
// Return deep copies to ensure immutability of the factory's internal state.
|
|
222
|
+
// JSON.parse(JSON.stringify(...)) is a common way to deep copy plain objects.
|
|
223
|
+
try {
|
|
224
|
+
return Object.freeze(Object.values(this.agentConfigs).map(config => JSON.parse(JSON.stringify(config))));
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
console.error("AgentFactory: Failed to deep copy agent configurations for listing.", error);
|
|
228
|
+
throw new AgentFactoryError(`Failed to list available agent configurations due to a cloning error: ${error.message}`, 'LIST_CONFIGS_CLONE_FAILED', undefined, error);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=AgentFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentFactory.js","sourceRoot":"","sources":["../../../src/core/agents/AgentFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC,CAAC,4BAA4B;AAElF;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAqB1C;;;;;;OAMG;IACH,YAAY,OAAe,EAAE,IAAY,EAAE,OAAgB,EAAE,eAAuB;QAClF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QAEvC,IAAI,eAAe,IAAI,eAAe,CAAC,KAAK,EAAE,CAAC;YAC7C,IAAI,CAAC,KAAK,GAAG,GAAG,IAAI,CAAC,OAAO,gBAAgB,eA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S,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;gBACjH,MAAM,IAAI,iBAAiB,CACzB,UAAU,OAAO,qEAAqE,SAAS,CAAC,OAAO,EAAE,EACzG,iCAAiC,EACjC,OAAO,EACP,SAAS,CACV,CAAC;YACJ,CAAC;QACH,CAAC;QACD,mHAAmH;QACnH,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,yBAAyB;QACpC,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,6EAA6E;QAC7E,8EAA8E;QAC9E,IAAI,CAAC;YACD,OAAO,MAAM,CAAC,MAAM,CAChB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CACrF,CAAC;QACN,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YAClB,OAAO,CAAC,KAAK,CAAC,qEAAqE,EAAE,KAAK,CAAC,CAAC;YAC5F,MAAM,IAAI,iBAAiB,CACvB,yEAAyE,KAAK,CAAC,OAAO,EAAE,EACxF,2BAA2B,EAC3B,SAAS,EACT,KAAK,CACR,CAAC;QACN,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Implements the `AgentPoolAgent`, a specialized type of `AgentCore`
|
|
3
|
+
* that functions as a manager or orchestrator for a collection of other "sub-agents".
|
|
4
|
+
* This agent embodies strategies like routing requests to the most suitable sub-agent,
|
|
5
|
+
* synthesizing responses from multiple sub-agents (mixture of experts), or delegating
|
|
6
|
+
* tasks directly.
|
|
7
|
+
*
|
|
8
|
+
* The `AgentPoolAgent` uses an `IAgentFactory` to instantiate its sub-agents based on
|
|
9
|
+
* IDs provided in its `AgentPoolConfig`. Its behavior is primarily dictated by the
|
|
10
|
+
* `AgentPoolStrategy` defined in its configuration.
|
|
11
|
+
*
|
|
12
|
+
* Key functionalities:
|
|
13
|
+
* - Loads and initializes a set of sub-agents.
|
|
14
|
+
* - Implements various strategies for sub-agent interaction and output generation.
|
|
15
|
+
* - Can maintain a "unified persona" for user-facing interactions, even if sub-agents
|
|
16
|
+
* have distinct characteristics.
|
|
17
|
+
* - Utilizes its own LLM provider and prompt engine for meta-tasks like routing
|
|
18
|
+
* decisions or synthesizing sub-agent outputs.
|
|
19
|
+
* @module backend/agentos/core/agents/AgentPoolAgent
|
|
20
|
+
*/
|
|
21
|
+
import { AgentCore, AgentConfig, AgentType } from './AgentCore';
|
|
22
|
+
import { IAgent, AgentOutput } from './IAgent';
|
|
23
|
+
import { AgentPoolConfig } from './AgentPoolConfig';
|
|
24
|
+
import { ConversationContext } from '../conversation/ConversationContext';
|
|
25
|
+
import { IProvider } from '../llm/providers/IProvider';
|
|
26
|
+
import { IPromptEngine } from '../llm/IPromptEngine';
|
|
27
|
+
import { Tool } from './tools/Tool';
|
|
28
|
+
import { IUtilityAI } from '../ai_utilities/IUtilityAI';
|
|
29
|
+
import { IAgentFactory, AgentDependencies } from './IAgentFactory';
|
|
30
|
+
/**
|
|
31
|
+
* Configuration specific to an `AgentPoolAgent`.
|
|
32
|
+
* It extends the base `AgentConfig` and mandates that the `type` is `AgentType.POOL`,
|
|
33
|
+
* and that `agentPoolOptions` (defined by `AgentPoolConfig`) are provided.
|
|
34
|
+
* @interface AgentPoolAgentConfig
|
|
35
|
+
* @extends {AgentConfig}
|
|
36
|
+
*/
|
|
37
|
+
export interface AgentPoolAgentConfig extends AgentConfig {
|
|
38
|
+
/**
|
|
39
|
+
* Specifies the type of this agent, which must be `AgentType.POOL`.
|
|
40
|
+
* @type {AgentType.POOL}
|
|
41
|
+
*/
|
|
42
|
+
type: AgentType.POOL;
|
|
43
|
+
/**
|
|
44
|
+
* Configuration settings specific to the agent pool's operation,
|
|
45
|
+
* including sub-agent IDs and interaction strategy.
|
|
46
|
+
* @type {AgentPoolConfig}
|
|
47
|
+
*/
|
|
48
|
+
agentPoolOptions: AgentPoolConfig;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A concrete agent implementation that acts as an intelligent coordinator or router
|
|
52
|
+
* for a collection of sub-agents. It encapsulates the logic for selecting,
|
|
53
|
+
* dispatching tasks to, and synthesizing results from its managed sub-agents,
|
|
54
|
+
* all based on a configured `AgentPoolStrategy`.
|
|
55
|
+
*
|
|
56
|
+
* @class AgentPoolAgent
|
|
57
|
+
* @extends {AgentCore}
|
|
58
|
+
* @implements {IAgent}
|
|
59
|
+
*/
|
|
60
|
+
export declare class AgentPoolAgent extends AgentCore implements IAgent {
|
|
61
|
+
/**
|
|
62
|
+
* The specific configuration for this agent pool's operations.
|
|
63
|
+
* @private
|
|
64
|
+
* @type {AgentPoolConfig}
|
|
65
|
+
*/
|
|
66
|
+
private readonly poolConfig;
|
|
67
|
+
/**
|
|
68
|
+
* A map storing the instantiated sub-agent instances, keyed by their agent IDs.
|
|
69
|
+
* @private
|
|
70
|
+
* @type {Map<string, IAgent>}
|
|
71
|
+
*/
|
|
72
|
+
private subAgents;
|
|
73
|
+
/**
|
|
74
|
+
* Snapshot of the dependencies originally supplied by the orchestrator/factory.
|
|
75
|
+
* Needed so the pool can instantiate sub-agents with the same services.
|
|
76
|
+
*/
|
|
77
|
+
private agentDependencies?;
|
|
78
|
+
/**
|
|
79
|
+
* Stores tools that are available to the pool agent itself. These might be
|
|
80
|
+
* different from tools available to individual sub-agents.
|
|
81
|
+
* @private
|
|
82
|
+
* @type {Tool[]}
|
|
83
|
+
*/
|
|
84
|
+
private availablePoolTools;
|
|
85
|
+
/**
|
|
86
|
+
* Constructs an `AgentPoolAgent` instance.
|
|
87
|
+
*
|
|
88
|
+
* @param {AgentPoolAgentConfig} config - The configuration for this agent pool.
|
|
89
|
+
* Must specify `type` as `AgentType.POOL` and include `agentPoolOptions`.
|
|
90
|
+
* @param {IPromptEngine} promptEngine - An instance of the `IPromptEngine`.
|
|
91
|
+
* @param {IProvider} llmProvider - The primary AI model provider for the pool agent's
|
|
92
|
+
* own meta-tasks (e.g., routing, synthesis).
|
|
93
|
+
* @param {IUtilityAI | undefined} utilityAI - Optional. An instance of an `IUtilityAI` service.
|
|
94
|
+
* @param {IAgentFactory} agentFactory - The `IAgentFactory` instance, which is **required**
|
|
95
|
+
* for the `AgentPoolAgent` to load and instantiate its sub-agents.
|
|
96
|
+
* @throws {AgentCoreError} If the configuration is invalid (e.g., missing `agentPoolOptions`)
|
|
97
|
+
* or if the `agentFactory` dependency is not provided.
|
|
98
|
+
*/
|
|
99
|
+
constructor(config: AgentPoolAgentConfig, promptEngine: IPromptEngine, llmProvider: IProvider, utilityAI: IUtilityAI | undefined, agentFactory: IAgentFactory);
|
|
100
|
+
/**
|
|
101
|
+
* Allows the orchestrator/factory to provide the dependency bundle that was used
|
|
102
|
+
* to construct this pool agent so it can reuse them when instantiating sub-agents.
|
|
103
|
+
*/
|
|
104
|
+
setAgentDependencies(dependencies: AgentDependencies): void;
|
|
105
|
+
/**
|
|
106
|
+
* Initializes the `AgentPoolAgent`. This involves:
|
|
107
|
+
* 1. Calling the base class `initialize` method.
|
|
108
|
+
* 2. Using the injected `IAgentFactory` to load and initialize all sub-agents
|
|
109
|
+
* specified in `this.poolConfig.subAgentIds`.
|
|
110
|
+
*
|
|
111
|
+
* @override
|
|
112
|
+
* @param {Record<string, any>} [configOverrides] - Optional configuration overrides applied during initialization.
|
|
113
|
+
* @returns {Promise<void>}
|
|
114
|
+
* @throws {AgentCoreError} If the `agentFactory` is missing or if any sub-agent fails to load or initialize.
|
|
115
|
+
*/
|
|
116
|
+
initialize(configOverrides?: Record<string, any>): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Resets the `AgentPoolAgent`'s internal state and propagates the reset call
|
|
119
|
+
* to all its managed sub-agents.
|
|
120
|
+
* @override
|
|
121
|
+
*/
|
|
122
|
+
reset(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Overrides the `processTurn` method from `AgentCore` to implement the specific
|
|
125
|
+
* orchestration logic of the `AgentPoolAgent` based on its configured strategy.
|
|
126
|
+
* This method will route tasks to, or synthesize results from, its sub-agents.
|
|
127
|
+
*
|
|
128
|
+
* @override
|
|
129
|
+
* @param {string | null} userInput - The latest input from the user.
|
|
130
|
+
* @param {ConversationContext} conversationContext - The current conversation context.
|
|
131
|
+
* @param {Tool[]} [availableTools] - Tools available to the pool agent itself (these might also
|
|
132
|
+
* be passed down to sub-agents depending on the strategy and sub-agent capabilities).
|
|
133
|
+
* @returns {Promise<AgentOutput>} The agent's response and actions, which could be a direct
|
|
134
|
+
* response, a synthesized response from sub-agents, or tool calls.
|
|
135
|
+
* @throws {AgentCoreError} If an unhandled error occurs within the chosen strategy.
|
|
136
|
+
*/
|
|
137
|
+
processTurn(userInput: string | null, conversationContext: ConversationContext, availableTools?: Tool[]): Promise<AgentOutput>;
|
|
138
|
+
/**
|
|
139
|
+
* Implements the `UNIFIED_PERSONA_ROUTING` strategy.
|
|
140
|
+
* This involves using an LLM (the pool agent's own) to select the most appropriate sub-agent
|
|
141
|
+
* based on the user input and sub-agent descriptions. The selected sub-agent's output
|
|
142
|
+
* is then rephrased by the pool agent to maintain a consistent unified persona.
|
|
143
|
+
*
|
|
144
|
+
* @private
|
|
145
|
+
* @param {string | null} userInput - The user's input.
|
|
146
|
+
* @param {ConversationContext} conversationContext - The current conversation context.
|
|
147
|
+
* @returns {Promise<AgentOutput>} The synthesized and persona-aligned output.
|
|
148
|
+
*/
|
|
149
|
+
private handleUnifiedPersonaRouting;
|
|
150
|
+
/**
|
|
151
|
+
* Implements the `MIXTURE_OF_EXPERTS_SYNTHESIS` strategy.
|
|
152
|
+
* Consults multiple (or all) sub-agents and then uses the pool's LLM to synthesize
|
|
153
|
+
* their contributions into a single, coherent response.
|
|
154
|
+
*
|
|
155
|
+
* @private
|
|
156
|
+
* @param {string | null} userInput - The user's input.
|
|
157
|
+
* @param {ConversationContext} conversationContext - The current conversation context.
|
|
158
|
+
* @returns {Promise<AgentOutput>} The synthesized output from the mixture of experts.
|
|
159
|
+
*/
|
|
160
|
+
private handleMixtureOfExpertsSynthesis;
|
|
161
|
+
/**
|
|
162
|
+
* Implements the `DIRECT_DELEGATION` strategy.
|
|
163
|
+
* Selects a single sub-agent (e.g., based on simple routing logic or configuration)
|
|
164
|
+
* and directly forwards its response without significant modification by the pool agent.
|
|
165
|
+
*
|
|
166
|
+
* @private
|
|
167
|
+
* @param {string | null} userInput - The user's input.
|
|
168
|
+
* @param {ConversationContext} conversationContext - The current conversation context.
|
|
169
|
+
* @returns {Promise<AgentOutput>} The output from the delegated sub-agent.
|
|
170
|
+
*/
|
|
171
|
+
private handleDirectDelegation;
|
|
172
|
+
/**
|
|
173
|
+
* Implements the `EXPLORATORY_GENERATION` strategy. (Placeholder - complex to fully implement here)
|
|
174
|
+
* Spawns sub-agents to explore different approaches for a problem, then evaluates
|
|
175
|
+
* and synthesizes their outputs. This is a more advanced strategy.
|
|
176
|
+
*
|
|
177
|
+
* @private
|
|
178
|
+
* @param {string | null} userInput - The user's input.
|
|
179
|
+
* @param {ConversationContext} conversationContext - The current conversation context.
|
|
180
|
+
* @returns {Promise<AgentOutput>} The synthesized result of the exploratory generation.
|
|
181
|
+
*/
|
|
182
|
+
private handleExploratoryGeneration;
|
|
183
|
+
/**
|
|
184
|
+
* Generates a prompt for the pool agent's internal LLM to perform routing to a sub-agent.
|
|
185
|
+
* The prompt includes descriptions of available sub-agents and the user's query.
|
|
186
|
+
*
|
|
187
|
+
* @private
|
|
188
|
+
* @param {string | null} userInput - The user's current input.
|
|
189
|
+
* @param {ConversationContext} conversationContext - For history and broader context.
|
|
190
|
+
* @param {IAgent[]} subAgents - The list of available sub-agents to choose from.
|
|
191
|
+
* @returns {Partial<PromptComponents>} The components for constructing the routing prompt.
|
|
192
|
+
*/
|
|
193
|
+
private generateRoutingPrompt;
|
|
194
|
+
/**
|
|
195
|
+
* Parses the LLM's response when it was tasked with routing, expecting just an agent ID or "NONE".
|
|
196
|
+
*
|
|
197
|
+
* @private
|
|
198
|
+
* @param {ModelCompletionResponse} llmResponse - The response from the routing LLM call.
|
|
199
|
+
* @param {string[]} validAgentIds - An array of valid sub-agent IDs for validation.
|
|
200
|
+
* @returns {string | null} The chosen agent ID, or `null` if parsing fails or "NONE" is returned.
|
|
201
|
+
*/
|
|
202
|
+
private parseLLMResponseForRouting;
|
|
203
|
+
/**
|
|
204
|
+
* Generates a prompt for the pool agent's internal LLM to synthesize outputs from multiple expert sub-agents.
|
|
205
|
+
*
|
|
206
|
+
* @private
|
|
207
|
+
* @param {string | null} originalUserInput - The initial user input that led to expert consultation.
|
|
208
|
+
* @param {ConversationContext} conversationContext - For overall context.
|
|
209
|
+
* @param {Array<{ agentId: string; agentName: string; agentDescription: string; output: AgentOutput; }>} expertResults - The outputs from consulted sub-agents.
|
|
210
|
+
* @returns {Partial<PromptComponents>} The components for constructing the synthesis prompt.
|
|
211
|
+
*/
|
|
212
|
+
private generateSynthesisPrompt;
|
|
213
|
+
/**
|
|
214
|
+
* A helper method to potentially rephrase or wrap a sub-agent's output to align
|
|
215
|
+
* with the pool's unified persona, if one is configured. Also finalizes metadata.
|
|
216
|
+
*
|
|
217
|
+
* @private
|
|
218
|
+
* @param {AgentOutput} subAgentOutput - The output from the sub-agent.
|
|
219
|
+
* @param {IAgent} sourceAgent - The sub-agent that produced the output.
|
|
220
|
+
* @param {ConversationContext} conversationContext - For context if rephrasing LLM call is needed.
|
|
221
|
+
* @param {string} internalActionDescription - Description of the pool's internal action (e.g., "Routed to expert").
|
|
222
|
+
* @param {boolean} [isDirectDelegation=false] - If true, rephrasing might be lighter or skipped.
|
|
223
|
+
* @returns {Promise<AgentOutput>} The finalized (potentially rephrased) `AgentOutput`.
|
|
224
|
+
*/
|
|
225
|
+
private synthesizeAndFinalizeOutput;
|
|
226
|
+
/**
|
|
227
|
+
* Overrides `handleToolResult` from `AgentCore`.
|
|
228
|
+
* This method is called when a tool initiated by the `AgentPoolAgent` itself completes.
|
|
229
|
+
* (Tools initiated by sub-agents are handled by their respective `handleToolResult` methods,
|
|
230
|
+
* and the orchestrator delivers the result to that sub-agent).
|
|
231
|
+
*
|
|
232
|
+
* The `AgentPoolAgent` might use tools for its meta-tasks, like a "SubAgentSelectionTool"
|
|
233
|
+
* or a "ContentAnalysisTool" to help in routing or synthesis.
|
|
234
|
+
*
|
|
235
|
+
* @override
|
|
236
|
+
* @param {string} toolCallId - The ID of the tool call this result pertains to.
|
|
237
|
+
* @param {any} toolOutput - The output from the tool execution.
|
|
238
|
+
* @param {string} toolName - The name of the tool that was called.
|
|
239
|
+
* @param {ConversationContext} conversationContext - The current conversation context.
|
|
240
|
+
* @returns {Promise<AgentOutput>} The pool agent's subsequent output after processing its own tool's result.
|
|
241
|
+
*/
|
|
242
|
+
handleToolResult(toolCallId: string, toolOutput: any, toolName: string, conversationContext: ConversationContext): Promise<AgentOutput>;
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=AgentPoolAgent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentPoolAgent.d.ts","sourceRoot":"","sources":["../../../src/core/agents/AgentPoolAgent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAkB,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAqB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAA2B,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAA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