from .apiConsole import apiConsole
from .clipit import ClipIt
from .finderConsole import finderConsole
from .logConsole import logConsole
from .appRunner import appRunner
from .reactRunner import *
from .windowManager import WindowManager
from .webPardner import webPardner
from .databaseViewer import databaseViewer
from .imageTab import startImageConsole, imageTab
from .dbImageViewer import startDbImageConsole,DbImageViewer
from .servicesTab import servicesTab
from .wireframeTab import wireframeTab
from .hugpyTab import hugpyTab
from abstract_gui.QT6 import QTabWidget,QMainWindow
from abstract_gui.QT6.utils.console_utils import ConsoleBase
from abstract_gui.QT6.utils.console_utils import startConsole

# Content Finder = the nested group you built (Find Content, Directory Map, Collect, Imports, Diff)
class ideConsole(ConsoleBase):
    def __init__(self, *, bus=None, parent=None):
        super().__init__(bus=bus, parent=parent)
        inner = QTabWidget()
        self.layout().addWidget(inner)
        # all content tabs share THIS console’s bus
        # RECOVERED 2026-07-11: reactTab functions/ (funcs/fuck/solo_funcs) rebuilt from orphaned .pyc.
        # Engine reconstructed from bytecode (Babel/ESM/tsx JS is verbatim; Python flow is best-effort);
        # reload_all/update_topbar_visibility are load-guarded so the tab always opens.
        inner.addTab(reactRunner(),      "react Runner")
        inner.addTab(finderConsole(),   "Finder")
        inner.addTab(apiConsole(),   "Api")
        inner.addTab(databaseViewer(),   "databaseViewer")   # FIXED 2026-07-11: functions/ recovered from .pyc
        inner.addTab(ClipIt(),   "Clipit")
        inner.addTab(webPardner(),   "Web Pardner")   # RECOVERED 2026-07-11: functions/initialize.py rebuilt from .pyc
        inner.addTab(WindowManager(),   "Window Mgr")
        inner.addTab(appRunner(),   "app runner")
        inner.addTab(imageTab(),   "Images")
        inner.addTab(servicesTab(),   "Services")   # ADDED 2026-07-11: PyQt6 port of abstract_parallels services_mgr
        inner.addTab(wireframeTab(),   "Wireframe")   # ADDED 2026-07-13: snap-grid UI wireframe canvas
        inner.addTab(hugpyTab(),   "Hugpy")   # ADDED 2026-07-13: hugpy fleet model-chat + catalog + fleet-health proxy
        #inner.addTab(DbImageViewer(),   "dbImageViewer")
        inner.addTab(logConsole(),   "logs")
        
    def start():
        startConsole(ideConsole)
        
