/**
 * Server Types
 *
 * Type definitions for the HTTP coordination server.
 */

/**
 * Configuration for the coordination server
 */
export interface ServerConfig {
  /** Port to listen on. Defaults to 3847 */
  port: number;
  /** Host to bind to. Defaults to 127.0.0.1 */
  host: string;
  /** Path to PID file. Defaults to ~/.cw/server.pid */
  pidFile: string;
}

/**
 * Server runtime state
 */
export interface ServerState {
  /** When the server was started */
  startedAt: Date;
  /** Number of managed processes */
  processCount: number;
}

/**
 * Health check response
 */
export interface HealthResponse {
  /** Always 'ok' when healthy */
  status: 'ok';
  /** Uptime in seconds */
  uptime: number;
  /** Number of managed processes */
  processCount: number;
}

/**
 * Status response with full server state
 */
export interface StatusResponse {
  /** Server state */
  server: {
    startedAt: string;
    uptime: number;
    pid: number;
  };
  /** List of managed processes */
  processes: Array<{
    id: string;
    pid: number;
    command: string;
    status: string;
    startedAt: string;
  }>;
}
