All files / src/sub-agents/dto create-sub-agent.dto.ts

100% Statements 14/14
100% Branches 0/0
100% Functions 0/0
100% Lines 14/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 916x             6x   6x     6x             6x               6x               6x               6x                 6x             6x         6x               6x               6x               6x    
import {
  IsString,
  IsOptional,
  IsBoolean,
  IsArray,
  IsUUID,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
 
export class CreateSubAgentDto {
  @ApiProperty({ description: 'Name of the sub-agent', example: 'Bug Fixer' })
  @IsString()
  name: string;
 
  @ApiPropertyOptional({
    description: 'Description of what this sub-agent does',
  })
  @IsOptional()
  @IsString()
  description?: string;
 
  @ApiPropertyOptional({
    description: 'UUID of system prompt for this sub-agent',
    format: 'uuid',
  })
  @IsOptional()
  @IsUUID()
  system_prompt_id?: string;
 
  @ApiPropertyOptional({
    description: 'UUID of context template for initial prompts',
    format: 'uuid',
  })
  @IsOptional()
  @IsUUID()
  context_template_id?: string;
 
  @ApiPropertyOptional({
    description: 'UUID of context template for follow-up prompts',
    format: 'uuid',
  })
  @IsOptional()
  @IsUUID()
  followup_context_template_id?: string;
 
  @ApiPropertyOptional({
    description: 'Array of tool names this sub-agent can use',
    example: ['create_file', 'overwrite_file'],
  })
  @IsOptional()
  @IsArray()
  @IsString({ each: true })
  enabled_tools?: string[];
  @ApiPropertyOptional({
    description:
      'Enabled MCP tools: null (no MCP tools), "all", or array of serverName__toolName identifiers',
    example: 'all',
  })
  @IsOptional()
  enabled_mcp_tools?: string[] | 'all';
 
  @ApiPropertyOptional({ description: 'Whether this sub-agent is active' })
  @IsOptional()
  @IsBoolean()
  is_active?: boolean;
 
  @ApiPropertyOptional({
    description: 'Model ID to use for this sub-agent',
    example: 'gemini-2.0-flash',
  })
  @IsOptional()
  @IsString()
  model_id?: string;
 
  @ApiPropertyOptional({
    description: 'Whether this is a built-in sub-agent (only used by seeding)',
    example: false,
  })
  @IsOptional()
  @IsBoolean()
  is_builtin?: boolean;
 
  @ApiPropertyOptional({
    description: 'Unique key for built-in sub-agents (only used by seeding)',
    example: 'explore-codebase',
  })
  @IsOptional()
  @IsString()
  builtin_key?: string;
}