@@ -726,3 +726,38 @@ def pip_install(
726726 pass
727727 code , _out , _err = run_process (gui , prog , args , timeout_ms = timeout_ms )
728728 return int (code )
729+
730+
731+ # -----------------------------------------------
732+ # ARK Configuration helpers
733+ # -----------------------------------------------
734+
735+
736+ def get_main_file_names (gui : Any ) -> list [str ]:
737+ """Get main_file_names from the ARK configuration.
738+
739+ Attempts to load the ARK config from the workspace and extract the main_file_names list.
740+ Falls back to the default ["main.py", "app.py"] if the config cannot be loaded.
741+
742+ Args:
743+ gui: The GUI object (MainWindow) with workspace_dir attribute
744+
745+ Returns:
746+ List of main file names (e.g., ["main.py", "app.py"])
747+ """
748+ try :
749+ from Core .ark_config_loader import load_ark_config
750+
751+ ws = getattr (gui , "workspace_dir" , None )
752+ if not ws :
753+ return ["main.py" , "app.py" ]
754+
755+ ark_config = load_ark_config (ws )
756+ main_names = ark_config .get ("main_file_names" , ["main.py" , "app.py" ])
757+
758+ if isinstance (main_names , list ):
759+ return [str (n ) for n in main_names if n ]
760+
761+ return ["main.py" , "app.py" ]
762+ except Exception :
763+ return ["main.py" , "app.py" ]
0 commit comments