MCPcopy Index your code
hub / github.com/codeaashu/claude-code / validateAgentType

Function validateAgentType

src/components/agents/validateAgent.ts:15–33  ·  view source on GitHub ↗
(agentType: string)

Source from the content-addressed store, hash-verified

13}
14
15export 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
35export function validateAgent(
36 agent: Omit<CustomAgentDefinition, 'location'>,

Callers 2

validateAgentFunction · 0.85
TypeStepFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected