/**
 * Instance Configuration DTOs
 *
 * Data Transfer Objects for instance configuration API.
 */

import { IsString, IsBoolean, IsOptional, IsObject, ValidateNested } from "class-validator";
import { Type } from "class-transformer";

/**
 * DTO for federation capabilities
 */
export class FederationCapabilitiesDto {
  @IsBoolean()
  supportsQuery!: boolean;

  @IsBoolean()
  supportsCommand!: boolean;

  @IsBoolean()
  supportsEvent!: boolean;

  @IsBoolean()
  supportsAgentSpawn!: boolean;

  @IsString()
  protocolVersion!: string;
}

/**
 * DTO for updating instance configuration
 */
export class UpdateInstanceDto {
  @IsOptional()
  @IsString()
  name?: string;

  @IsOptional()
  @ValidateNested()
  @Type(() => FederationCapabilitiesDto)
  capabilities?: FederationCapabilitiesDto;

  @IsOptional()
  @IsObject()
  metadata?: Record<string, unknown>;
}
