// CxLLM Studio — iOS Application // CxLLMStudioApp.swift — Main app entry point import SwiftUI import CxCode import CxAWS import CxGit @main struct CxLLMStudioApp: App { @State private var appState = AppState() @State private var gatewayService: GatewayService @State private var modelController: CxModelController @State private var awsService: AWSService @State private var gitService: GitService @State private var agentService: AgentService @State private var mcpService: MCPService init() { let config = CxConfig.fromEnvironment() let gateway = CxGateway(config: config) self._gatewayService = State(initialValue: GatewayService(gateway: gateway)) self._modelController = State(initialValue: CxModelController(gateway: gateway)) self._awsService = State(initialValue: AWSService(config: CxAWSConfig())) self._gitService = State(initialValue: GitService()) self._agentService = State(initialValue: AgentService(gateway: gateway)) self._mcpService = State(initialValue: MCPService(gateway: gateway)) } var body: some Scene { WindowGroup { ContentView() .environment(appState) .environment(gatewayService) .environment(modelController) .environment(awsService) .environment(gitService) .environment(agentService) .environment(mcpService) .task { await gatewayService.checkHealth() await modelController.loadModels() await awsService.checkHealth() await gitService.checkHealth() await agentService.initialize() await mcpService.initialize() } } } }