import { Type } from 'class-transformer'; import { ArrayMaxSize, IsArray, IsInt, IsOptional, IsString, IsUUID, Max, MaxLength, Min, MinLength, ValidateNested } from 'class-validator'; class AgentWorkspaceFileDto { @IsString() @MaxLength(500) path: string; @IsString() @MaxLength(100_000) content: string; } class AgentWorkspaceModuleDto { @IsString() @MaxLength(120) name: string; @IsOptional() @IsString() @MaxLength(120) folderName?: string; @IsOptional() @IsString() @MaxLength(80) category?: string; @IsOptional() @IsString() @MaxLength(20) state?: string; @IsArray() @ArrayMaxSize(24) @ValidateNested({ each: true }) @Type(() => AgentWorkspaceFileDto) files: AgentWorkspaceFileDto[]; } class AgentRuntimeLogDto { @IsString() @MinLength(1) @MaxLength(120) moduleName: string; @IsString() @MinLength(1) @MaxLength(40) state: string; @IsString() @MaxLength(20_000) content: string; @IsOptional() @IsString() @MaxLength(500) message?: string; } export class CreateAgentPlanDto { @IsUUID() courseId: string; @IsOptional() @IsInt() @Min(1) @Max(100) week?: number; @IsString() @MinLength(1) @MaxLength(4000) request: string; @IsArray() @ArrayMaxSize(12) @ValidateNested({ each: true }) @Type(() => AgentWorkspaceModuleDto) modules: AgentWorkspaceModuleDto[]; @IsOptional() @IsArray() @ArrayMaxSize(3) @ValidateNested({ each: true }) @Type(() => AgentRuntimeLogDto) runtimeLogs?: AgentRuntimeLogDto[]; }