(agentType: string)
| 13 | } |
| 14 | |
| 15 | export function validateAgentType(agentType: string): string | null { |
| 16 | if (!agentType) { |
| 17 | return 'Agent type is required' |
| 18 | } |
| 19 | |
| 20 | if (!/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/.test(agentType)) { |
| 21 | return 'Agent type must start and end with alphanumeric characters and contain only letters, numbers, and hyphens' |
| 22 | } |
| 23 | |
| 24 | if (agentType.length < 3) { |
| 25 | return 'Agent type must be at least 3 characters long' |
| 26 | } |
| 27 | |
| 28 | if (agentType.length > 50) { |
| 29 | return 'Agent type must be less than 50 characters' |
| 30 | } |
| 31 | |
| 32 | return null |
| 33 | } |
| 34 | |
| 35 | export function validateAgent( |
| 36 | agent: Omit<CustomAgentDefinition, 'location'>, |
no outgoing calls
no test coverage detected