import Foundation import SprachmittlerCore import SprachmittlerEngines import SprachmittlerOllama /// The CLI composition root. Concrete clients are created only here (CODING_STANDARDS). struct CLIEnvironment: Sendable { let baseURL: URL let allowRemote: Bool func makeHTTPClient() throws -> OllamaHTTPClient { try OllamaHTTPClient(baseURL: baseURL, allowRemote: allowRemote) } func makeCatalog() throws -> any OllamaCatalog { try OllamaCatalogClient(http: makeHTTPClient()) } func makeChatClient() throws -> OllamaChatClient { try OllamaChatClient(http: makeHTTPClient()) } func makeRegistry() -> AdapterRegistry { AdapterRegistry(adapters: [HyMT3Adapter()]) } func makePipeline() throws -> TranslationPipeline { try TranslationPipeline( chat: makeChatClient(), registry: makeRegistry() ) } }