export interface RuntimeStatus {
  pid: number;
  ready: boolean;
  startedAt: string;
  port: number;
  url: string;
  controlBaseUrl: string;
  paths: {
    dataDir: string;
    logDir: string;
    configDir: string;
  };
}

export function buildRuntimeStatus(input: {
  pid: number;
  ready: boolean;
  startedAt: string;
  port: number;
  controlBaseUrl: string;
  dataDir: string;
  logDir: string;
  configDir: string;
}): RuntimeStatus {
  return {
    pid: input.pid,
    ready: input.ready,
    startedAt: input.startedAt,
    port: input.port,
    url: `http://127.0.0.1:${input.port}`,
    controlBaseUrl: input.controlBaseUrl,
    paths: {
      dataDir: input.dataDir,
      logDir: input.logDir,
      configDir: input.configDir,
    },
  };
}
