* Processes agent definitions array and converts handleSteps functions to strings
( agentDefinitions: AgentDefinition[], )
| 85 | * Processes agent definitions array and converts handleSteps functions to strings |
| 86 | */ |
| 87 | function processAgentDefinitions( |
| 88 | agentDefinitions: AgentDefinition[], |
| 89 | ): Record<string, any> { |
| 90 | const processedAgentTemplates: Record<string, any> = {} |
| 91 | agentDefinitions.forEach((definition) => { |
| 92 | const processedConfig = { ...definition } as Record<string, any> |
| 93 | if ( |
| 94 | processedConfig.handleSteps && |
| 95 | typeof processedConfig.handleSteps === 'function' |
| 96 | ) { |
| 97 | processedConfig.handleSteps = processedConfig.handleSteps.toString() |
| 98 | } |
| 99 | if (processedConfig.id) { |
| 100 | processedAgentTemplates[processedConfig.id] = processedConfig |
| 101 | } |
| 102 | }) |
| 103 | return processedAgentTemplates |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Processes custom tool definitions into the format expected by SessionState. |
no outgoing calls
no test coverage detected