CxLLM-IOS/CxLLMStudio/CxLLMStudioApp.swift
2026-05-16 10:52:04 -05:00

51 lines
1.8 KiB
Swift

// 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()
}
}
}
}