function composeCommandsConfig(options) {
  const { appsConfig, localConfig } = options;
  /** @type {[string | undefined, Detox.DetoxAppConfig | Detox.DetoxConfiguration][]} */
  const entries = [[undefined, localConfig], ...Object.entries(appsConfig)];

  return entries.map(extractGroup).filter(hasCommands);
}
@param {{
 appsConfig: Record<string, Detox.DetoxAppConfig>
 localConfig: Detox.DetoxConfiguration;
}} options
@returns {DetoxInternals.RuntimeCommandsGroup[]}