The Swift Package Index logo.Swift Package Index

Build Information

Failed to build swift-ai-sdk, reference 0.3.0 (d8d108), with Swift 6.1 for Wasm on 13 Aug 2026 01:29:31 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-53886769-0":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:wasm-6.1-latest swift build --swift-sdk wasm32-unknown-wasi 2>&1

Build Log

44 |     static func events(
45 |         from bytes: URLSession.AsyncBytes
   |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
46 |     ) -> AsyncThrowingStream<SSEEvent, Error> {
47 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:130:26: error: cannot find 'URLRequest' in scope
128 |         }
129 |
130 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
131 |         urlRequest.httpMethod = "POST"
132 |         urlRequest.setValue(apiKey, forHTTPHeaderField: "x-goog-api-key")
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:10:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  8 |     var baseURL: URL
  9 |     var headers: [String: String]
 10 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:12:80: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 10 |     var urlSession: URLSession
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
    |                                                                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 13 |         self.apiKey = apiKey
 14 |             ?? ProcessInfo.processInfo.environment["GOOGLE_GENERATIVE_AI_API_KEY"]
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:21:86: error: cannot find type 'URLRequest' in scope
 19 |     }
 20 |
 21 |     func request(_ method: String, _ path: String, query: [String: String] = [:]) -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
 22 |         // `path` is an absolute URL only when it came from a response — an
 23 |         // operation name or a file `uri`. Those live on the API host, so the
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:84:35: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 82 |     }
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
    |                                   `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
  |                  `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:10:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleHTTP' has non-sendable type 'URLSession' (aka 'AnyObject')
  8 |     var baseURL: URL
  9 |     var headers: [String: String]
 10 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleHTTP' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:124:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 |         uploadBaseURL: URL = URL(string: "https://generativelanguage.googleapis.com/upload/v1beta")!,
123 |         headers: [String: String] = [:],
124 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
125 |     ) {
126 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:124:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
122 |         uploadBaseURL: URL = URL(string: "https://generativelanguage.googleapis.com/upload/v1beta")!,
123 |         headers: [String: String] = [:],
124 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
125 |     ) {
126 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:231:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
229 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
230 |         headers: [String: String] = [:],
231 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
232 |     ) {
233 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:231:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
229 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
230 |         headers: [String: String] = [:],
231 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
232 |     ) {
233 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:332:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
330 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
331 |         headers: [String: String] = [:],
332 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
333 |     ) {
334 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:332:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
330 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
331 |         headers: [String: String] = [:],
332 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
333 |     ) {
334 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:36:23: error: cannot find 'URLRequest' in scope
 34 |             url = components.url ?? base
 35 |         }
 36 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
 37 |         request.httpMethod = method
 38 |         if !apiKey.isEmpty, trusted {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:59:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 57 |             urlRequest.httpBody = try JSONEncoder().encode(json)
 58 |         }
 59 |         let (data, response) = try await urlSession.data(for: urlRequest)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 60 |         try Self.check(response, data)
 61 |         return data.isEmpty ? .object([:]) : try JSONDecoder().decode(JSONValue.self, from: data)
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:66:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 64 |     func download(_ path: String) async throws -> Data {
 65 |         try Self.checkAbsolute(path, baseURL: baseURL)
 66 |         let (data, response) = try await urlSession.data(for: request("GET", path))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 67 |         try Self.check(response, data)
 68 |         return data
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:32: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:36: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                    `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
  |                  `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:80: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                                                                `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:86:45: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
    |                                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 87 |         }
 88 |     }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:137:21: error: cannot find 'URLRequest' in scope
135 |         displayName: String? = nil
136 |     ) async throws -> GoogleFile {
137 |         var start = URLRequest(url: uploadBaseURL.appendingPathComponent("files"))
    |                     `- error: cannot find 'URLRequest' in scope
138 |         start.httpMethod = "POST"
139 |         if !http.apiKey.isEmpty {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:152:68: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
150 |         start.httpBody = try JSONEncoder().encode(JSONValue.object(["file": .object(metadata)]))
151 |
152 |         let (startData, startResponse) = try await http.urlSession.data(for: start)
    |                                                                    `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
153 |         try GoogleHTTP.check(startResponse, startData)
154 |         guard let httpResponse = startResponse as? HTTPURLResponse,
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:162:22: error: cannot find 'URLRequest' in scope
160 |         }
161 |
162 |         var upload = URLRequest(url: uploadURL)
    |                      `- error: cannot find 'URLRequest' in scope
163 |         upload.httpMethod = "POST"
164 |         upload.setValue("\(data.count)", forHTTPHeaderField: "Content-Length")
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:169:70: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
167 |         upload.httpBody = data
168 |
169 |         let (uploadData, uploadResponse) = try await http.urlSession.data(for: upload)
    |                                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
170 |         try GoogleHTTP.check(uploadResponse, uploadData)
171 |         let json = try JSONDecoder().decode(JSONValue.self, from: uploadData)
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:21:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     private let baseURL: URL?
 20 |     private let headers: [String: String]
 21 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 22 |
 23 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:31:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 32 |     ) {
 33 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:31:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:57:69: error: cannot find type 'URLRequest' in scope
 55 |     }
 56 |
 57 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
 58 |         let base = try resolvedBaseURL()
 59 |         guard let url = URL(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:21:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleVertexModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 19 |     private let baseURL: URL?
 20 |     private let headers: [String: String]
 21 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleVertexModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 22 |
 23 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:65:26: error: cannot find 'URLRequest' in scope
 63 |         }
 64 |
 65 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
 66 |         urlRequest.httpMethod = "POST"
 67 |         switch auth {
/host/spi-builder-workspace/Sources/AI/Providers/GroqModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = groqConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GroqModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = groqConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/HuggingFaceModel.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         baseURL: URL = URL(string: "https://router.huggingface.co/v1")!,
16 |         headers: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) {
19 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/HuggingFaceModel.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
15 |         baseURL: URL = URL(string: "https://router.huggingface.co/v1")!,
16 |         headers: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
18 |     ) {
19 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:17:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let baseURL: URL
 16 |     private let headers: [String: String]
 17 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     private let pollInterval: TimeInterval
 19 |     private let pollTimeout: TimeInterval
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:29:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 27 |         pollInterval: TimeInterval = 5,
 28 |         pollTimeout: TimeInterval = 600,
 29 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 30 |     ) {
 31 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:29:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 27 |         pollInterval: TimeInterval = 5,
 28 |         pollTimeout: TimeInterval = 600,
 29 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 30 |     ) {
 31 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:105:17: error: cannot find type 'URLRequest' in scope
103 |     func buildCreateRequest(
104 |         _ request: VideoModelRequest, endpoint: String, modelName: String
105 |     ) throws -> URLRequest {
    |                 `- error: cannot find type 'URLRequest' in scope
106 |         var body: [String: JSONValue] = [
107 |             "model_name": .string(modelName),
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:17:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'KlingVideoModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 15 |     private let baseURL: URL
 16 |     private let headers: [String: String]
 17 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'KlingVideoModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 18 |     private let pollInterval: TimeInterval
 19 |     private let pollTimeout: TimeInterval
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:64:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 62 |         let route = Self.route(modelID, hasImage: request.image != nil)
 63 |         let endpoint = route.endpoint
 64 |         let (createData, createResponse) = try await urlSession.data(
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 65 |             for: try buildCreateRequest(request, endpoint: endpoint, modelName: route.apiModelName)
 66 |         )
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:79:24: error: cannot find 'URLRequest' in scope
 77 |             try await Task.sleep(nanoseconds: pollNanoseconds(pollInterval))
 78 |             if Date() > deadline { throw AIError.transport("Kling video generation timed out") }
 79 |             var poll = URLRequest(
    |                        `- error: cannot find 'URLRequest' in scope
 80 |                 url: baseURL.appendingPathComponent("v1/videos/\(endpoint)/\(taskID)")
 81 |             )
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:84:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 82 |             poll.setValue("Bearer \(try authToken())", forHTTPHeaderField: "Authorization")
 83 |             for (field, value) in headers { poll.setValue(value, forHTTPHeaderField: field) }
 84 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 85 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
 86 |             switch status["data"]?["task_status"]?.stringValue {
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:123:26: error: cannot find 'URLRequest' in scope
121 |         }
122 |
123 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent("v1/videos/\(endpoint)"))
    |                          `- error: cannot find 'URLRequest' in scope
124 |         urlRequest.httpMethod = "POST"
125 |         urlRequest.setValue("Bearer \(try authToken())", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/LMStudioModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = lmStudioConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/LMStudioModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = lmStudioConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:13:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |     private let baseURL: URL
 12 |     private let headers: [String: String]
 13 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 14 |
 15 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:20:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |         baseURL: URL = URL(string: "https://fal.run")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |     ) {
 22 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:20:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 18 |         baseURL: URL = URL(string: "https://fal.run")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 21 |     ) {
 22 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:52:66: error: cannot find type 'URLRequest' in scope
 50 |     }
 51 |
 52 |     func buildURLRequest(_ request: ImageModelRequest) throws -> URLRequest {
    |                                                                  `- error: cannot find type 'URLRequest' in scope
 53 |         var body: [String: JSONValue] = [
 54 |             "prompt": .string(request.prompt),
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:13:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'FalImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |     private let baseURL: URL
 12 |     private let headers: [String: String]
 13 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'FalImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 14 |
 15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:94:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         pollInterval: TimeInterval = 2,
 93 |         pollTimeout: TimeInterval = 300,
 94 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 95 |     ) {
 96 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:94:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         pollInterval: TimeInterval = 2,
 93 |         pollTimeout: TimeInterval = 300,
 94 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 95 |     ) {
 96 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:134:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
132 |         pollInterval: TimeInterval = 5,
133 |         pollTimeout: TimeInterval = 600,
134 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
135 |     ) {
136 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:134:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
132 |         pollInterval: TimeInterval = 5,
133 |         pollTimeout: TimeInterval = 600,
134 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
135 |     ) {
136 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:172:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
170 |     var pollInterval: TimeInterval
171 |     var pollTimeout: TimeInterval
172 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
173 |
174 |     func generate(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:172:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'LumaGenerationEngine' has non-sendable type 'URLSession' (aka 'AnyObject')
170 |     var pollInterval: TimeInterval
171 |     var pollTimeout: TimeInterval
172 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'LumaGenerationEngine' has non-sendable type 'URLSession' (aka 'AnyObject')
173 |
174 |     func generate(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:236:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
234 |     private let baseURL: URL
235 |     private let headers: [String: String]
236 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
237 |
238 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:243:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
241 |         baseURL: URL = URL(string: "https://api.replicate.com/v1")!,
242 |         headers: [String: String] = [:],
243 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
244 |     ) {
245 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:243:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
241 |         baseURL: URL = URL(string: "https://api.replicate.com/v1")!,
242 |         headers: [String: String] = [:],
243 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
244 |     ) {
245 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:279:66: error: cannot find type 'URLRequest' in scope
277 |     }
278 |
279 |     func buildURLRequest(_ request: ImageModelRequest) throws -> URLRequest {
    |                                                                  `- error: cannot find type 'URLRequest' in scope
280 |         var input: [String: JSONValue] = ["prompt": .string(request.prompt)]
281 |         if request.n > 1 { input["num_outputs"] = .number(Double(request.n)) }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:236:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'ReplicateImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
234 |     private let baseURL: URL
235 |     private let headers: [String: String]
236 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'ReplicateImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
237 |
238 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:33:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 31 |
 32 |     public func generateImages(_ request: ImageModelRequest) async throws -> ImageModelResponse {
 33 |         let (data, response) = try await urlSession.data(for: try buildURLRequest(request))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 34 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 35 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:39:29: error: value of type 'Any' has no subscripts
 37 |         let decoded = try JSONDecoder().decode(JSONValue.self, from: data)
 38 |         let urls = (decoded["images"]?.arrayValue ?? [])
 39 |             .compactMap { $0["url"]?.stringValue }
    |                             `- error: value of type 'Any' has no subscripts
 40 |             .compactMap(URL.init(string:))
 41 |         guard !urls.isEmpty else {
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:46:51: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 44 |         var images: [Data] = []
 45 |         for url in urls {
 46 |             let (bytes, _) = try await urlSession.data(from: url)
    |                                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 47 |             images.append(bytes)
 48 |         }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:71:26: error: cannot find 'URLRequest' in scope
 69 |         }
 70 |
 71 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent(modelID))
    |                          `- error: cannot find 'URLRequest' in scope
 72 |         urlRequest.httpMethod = "POST"
 73 |         urlRequest.setValue("Key \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:116:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
114 |             $0["assets"]?["image"]?.stringValue
115 |         }
116 |         let (bytes, _) = try await engine.urlSession.data(from: assetURL)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
117 |         return ImageModelResponse(images: [bytes])
118 |     }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:179:22: error: cannot find 'URLRequest' in scope
177 |         asset: @Sendable (JSONValue) -> String?
178 |     ) async throws -> URL {
179 |         var create = URLRequest(
    |                      `- error: cannot find 'URLRequest' in scope
180 |             url: baseURL.appendingPathComponent("dream-machine/v1/\(path)")
181 |         )
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:188:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
186 |         create.httpBody = try JSONEncoder().encode(body)
187 |
188 |         let (createData, createResponse) = try await urlSession.data(for: create)
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
189 |         if let http = createResponse as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
190 |             throw AIError.http(status: http.statusCode, body: String(decoding: createData, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:199:24: error: cannot find 'URLRequest' in scope
197 |             try await Task.sleep(nanoseconds: UInt64(pollInterval * 1_000_000_000))
198 |             if Date() > deadline { throw AIError.transport("Luma generation timed out") }
199 |             var poll = URLRequest(
    |                        `- error: cannot find 'URLRequest' in scope
200 |                 url: baseURL.appendingPathComponent("dream-machine/v1/generations/\(id)")
201 |             )
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:203:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
201 |             )
202 |             poll.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
203 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
204 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
205 |             if let assetURL = try Self.resolvePoll(status, asset: asset) { return assetURL }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:253:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
251 |
252 |     public func generateImages(_ request: ImageModelRequest) async throws -> ImageModelResponse {
253 |         let (data, response) = try await urlSession.data(for: try buildURLRequest(request))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
254 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
255 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:261:43: error: cannot infer key path type from context; consider explicitly specifying a root type
259 |         let urlStrings: [String]
260 |         if let array = output?.arrayValue {
261 |             urlStrings = array.compactMap(\.stringValue)
    |                                           `- error: cannot infer key path type from context; consider explicitly specifying a root type
262 |         } else if let single = output?.stringValue {
263 |             urlStrings = [single]
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:273:51: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
271 |         for urlString in urlStrings {
272 |             guard let url = URL(string: urlString) else { continue }
273 |             let (bytes, _) = try await urlSession.data(from: url)
    |                                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
274 |             images.append(bytes)
275 |         }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:298:26: error: cannot find 'URLRequest' in scope
296 |         }
297 |
298 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
299 |         urlRequest.httpMethod = "POST"
300 |         urlRequest.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:24:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 22 |         baseURL: URL = MetaModel.defaultBaseURL,
 23 |         headers: [String: String] = [:],
 24 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 25 |     ) {
 26 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:24:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 22 |         baseURL: URL = MetaModel.defaultBaseURL,
 23 |         headers: [String: String] = [:],
 24 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 25 |     ) {
 26 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:43:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 41 |         baseURL: URL = MetaModel.defaultBaseURL,
 42 |         headers: [String: String] = [:],
 43 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     ) -> MetaModel {
 45 |         MetaModel(modelID: modelID, chatEngine: OpenAIChatModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:43:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 41 |         baseURL: URL = MetaModel.defaultBaseURL,
 42 |         headers: [String: String] = [:],
 43 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     ) -> MetaModel {
 45 |         MetaModel(modelID: modelID, chatEngine: OpenAIChatModel(
/host/spi-builder-workspace/Sources/AI/Providers/MistralModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = mistralConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MistralModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = mistralConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/MoonshotModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = moonshotConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MoonshotModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = moonshotConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/OllamaModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = ollamaConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OllamaModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = ollamaConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleModelSupport.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         headers: [String: String],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) -> OpenAIChatModel {
19 |         OpenAIChatModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleModelSupport.swift:35:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
33 |         baseURL: URL?,
34 |         headers: [String: String],
35 |         urlSession: URLSession
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
36 |     ) -> OpenAIEmbeddingModel {
37 |         OpenAIEmbeddingModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
15 |         headers: [String: String] = [:],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
18 |     ) {
19 |         self.name = name
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:9:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 7 |     public var headers: [String: String]
 8 |     public var queryParams: [String: String]
 9 |     private let urlSession: URLSession
   |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
10 |
11 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         headers: [String: String] = [:],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) {
19 |         self.name = name
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:9:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'OpenAICompatibleProvider' has non-sendable type 'URLSession' (aka 'AnyObject')
 7 |     public var headers: [String: String]
 8 |     public var queryParams: [String: String]
 9 |     private let urlSession: URLSession
   |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'OpenAICompatibleProvider' has non-sendable type 'URLSession' (aka 'AnyObject')
10 |
11 |     public init(
[106/130] Compiling AI OpenAICompatibleModelSupport.swift
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 16 |         headers: [String: String] = [:],
 17 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     ) {
 19 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 15 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 16 |         headers: [String: String] = [:],
 17 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 18 |     ) {
 19 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:86:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 84 |         pollTimeout: Duration = .seconds(600),
 85 |         headers: [String: String] = [:],
 86 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 |     ) {
 88 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:86:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 84 |         pollTimeout: Duration = .seconds(600),
 85 |         headers: [String: String] = [:],
 86 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 87 |     ) {
 88 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:180:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
178 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
179 |         headers: [String: String] = [:],
180 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
181 |     ) {
182 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:180:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
178 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
179 |         headers: [String: String] = [:],
180 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
181 |     ) {
182 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:255:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
253 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
254 |         headers: [String: String] = [:],
255 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
256 |     ) {
257 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:255:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
253 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
254 |         headers: [String: String] = [:],
255 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
256 |     ) {
257 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:13:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |     let baseURL: URL
 12 |     let headers: [String: String]
 13 |     let urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 14 |
 15 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:20:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |     ) {
 22 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:20:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 18 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 21 |     ) {
 22 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:38:23: error: cannot find type 'URLRequest' in scope
 36 |
 37 |     static func streamGenerateContent(
 38 |         _ urlRequest: URLRequest,
    |                       `- error: cannot find type 'URLRequest' in scope
 39 |         urlSession: URLSession
 40 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:39:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 37 |     static func streamGenerateContent(
 38 |         _ urlRequest: URLRequest,
 39 |         urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 40 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 41 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:123:69: error: cannot find type 'URLRequest' in scope
121 |     }
122 |
123 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
124 |         guard let url = URL(
125 |             string: "\(baseURL.absoluteString)/models/\(modelID):streamGenerateContent?alt=sse"
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:13:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |     let baseURL: URL
 12 |     let headers: [String: String]
 13 |     let urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 14 |
 15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:41:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 39 |         urlSession: URLSession
 40 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 41 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 42 |
 43 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
/host/spi-builder-workspace/Sources/AI/Streaming/SSE.swift:45:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
43 | enum SSE {
44 |     static func events(
45 |         from bytes: URLSession.AsyncBytes
   |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
46 |     ) -> AsyncThrowingStream<SSEEvent, Error> {
47 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:130:26: error: cannot find 'URLRequest' in scope
128 |         }
129 |
130 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
131 |         urlRequest.httpMethod = "POST"
132 |         urlRequest.setValue(apiKey, forHTTPHeaderField: "x-goog-api-key")
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:10:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  8 |     var baseURL: URL
  9 |     var headers: [String: String]
 10 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:12:80: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 10 |     var urlSession: URLSession
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
    |                                                                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 13 |         self.apiKey = apiKey
 14 |             ?? ProcessInfo.processInfo.environment["GOOGLE_GENERATIVE_AI_API_KEY"]
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:21:86: error: cannot find type 'URLRequest' in scope
 19 |     }
 20 |
 21 |     func request(_ method: String, _ path: String, query: [String: String] = [:]) -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
 22 |         // `path` is an absolute URL only when it came from a response — an
 23 |         // operation name or a file `uri`. Those live on the API host, so the
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:84:35: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 82 |     }
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
    |                                   `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
  |                  `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:10:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleHTTP' has non-sendable type 'URLSession' (aka 'AnyObject')
  8 |     var baseURL: URL
  9 |     var headers: [String: String]
 10 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleHTTP' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:124:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 |         uploadBaseURL: URL = URL(string: "https://generativelanguage.googleapis.com/upload/v1beta")!,
123 |         headers: [String: String] = [:],
124 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
125 |     ) {
126 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:124:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
122 |         uploadBaseURL: URL = URL(string: "https://generativelanguage.googleapis.com/upload/v1beta")!,
123 |         headers: [String: String] = [:],
124 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
125 |     ) {
126 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:231:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
229 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
230 |         headers: [String: String] = [:],
231 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
232 |     ) {
233 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:231:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
229 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
230 |         headers: [String: String] = [:],
231 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
232 |     ) {
233 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:332:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
330 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
331 |         headers: [String: String] = [:],
332 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
333 |     ) {
334 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:332:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
330 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
331 |         headers: [String: String] = [:],
332 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
333 |     ) {
334 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:36:23: error: cannot find 'URLRequest' in scope
 34 |             url = components.url ?? base
 35 |         }
 36 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
 37 |         request.httpMethod = method
 38 |         if !apiKey.isEmpty, trusted {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:59:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 57 |             urlRequest.httpBody = try JSONEncoder().encode(json)
 58 |         }
 59 |         let (data, response) = try await urlSession.data(for: urlRequest)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 60 |         try Self.check(response, data)
 61 |         return data.isEmpty ? .object([:]) : try JSONDecoder().decode(JSONValue.self, from: data)
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:66:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 64 |     func download(_ path: String) async throws -> Data {
 65 |         try Self.checkAbsolute(path, baseURL: baseURL)
 66 |         let (data, response) = try await urlSession.data(for: request("GET", path))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 67 |         try Self.check(response, data)
 68 |         return data
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:32: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:36: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                    `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
  |                  `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:80: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                                                                `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:86:45: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
    |                                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 87 |         }
 88 |     }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:137:21: error: cannot find 'URLRequest' in scope
135 |         displayName: String? = nil
136 |     ) async throws -> GoogleFile {
137 |         var start = URLRequest(url: uploadBaseURL.appendingPathComponent("files"))
    |                     `- error: cannot find 'URLRequest' in scope
138 |         start.httpMethod = "POST"
139 |         if !http.apiKey.isEmpty {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:152:68: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
150 |         start.httpBody = try JSONEncoder().encode(JSONValue.object(["file": .object(metadata)]))
151 |
152 |         let (startData, startResponse) = try await http.urlSession.data(for: start)
    |                                                                    `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
153 |         try GoogleHTTP.check(startResponse, startData)
154 |         guard let httpResponse = startResponse as? HTTPURLResponse,
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:162:22: error: cannot find 'URLRequest' in scope
160 |         }
161 |
162 |         var upload = URLRequest(url: uploadURL)
    |                      `- error: cannot find 'URLRequest' in scope
163 |         upload.httpMethod = "POST"
164 |         upload.setValue("\(data.count)", forHTTPHeaderField: "Content-Length")
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:169:70: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
167 |         upload.httpBody = data
168 |
169 |         let (uploadData, uploadResponse) = try await http.urlSession.data(for: upload)
    |                                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
170 |         try GoogleHTTP.check(uploadResponse, uploadData)
171 |         let json = try JSONDecoder().decode(JSONValue.self, from: uploadData)
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:21:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     private let baseURL: URL?
 20 |     private let headers: [String: String]
 21 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 22 |
 23 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:31:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 32 |     ) {
 33 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:31:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:57:69: error: cannot find type 'URLRequest' in scope
 55 |     }
 56 |
 57 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
 58 |         let base = try resolvedBaseURL()
 59 |         guard let url = URL(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:21:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleVertexModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 19 |     private let baseURL: URL?
 20 |     private let headers: [String: String]
 21 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleVertexModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 22 |
 23 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:65:26: error: cannot find 'URLRequest' in scope
 63 |         }
 64 |
 65 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
 66 |         urlRequest.httpMethod = "POST"
 67 |         switch auth {
/host/spi-builder-workspace/Sources/AI/Providers/GroqModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = groqConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GroqModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = groqConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/HuggingFaceModel.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         baseURL: URL = URL(string: "https://router.huggingface.co/v1")!,
16 |         headers: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) {
19 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/HuggingFaceModel.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
15 |         baseURL: URL = URL(string: "https://router.huggingface.co/v1")!,
16 |         headers: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
18 |     ) {
19 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:17:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let baseURL: URL
 16 |     private let headers: [String: String]
 17 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     private let pollInterval: TimeInterval
 19 |     private let pollTimeout: TimeInterval
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:29:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 27 |         pollInterval: TimeInterval = 5,
 28 |         pollTimeout: TimeInterval = 600,
 29 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 30 |     ) {
 31 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:29:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 27 |         pollInterval: TimeInterval = 5,
 28 |         pollTimeout: TimeInterval = 600,
 29 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 30 |     ) {
 31 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:105:17: error: cannot find type 'URLRequest' in scope
103 |     func buildCreateRequest(
104 |         _ request: VideoModelRequest, endpoint: String, modelName: String
105 |     ) throws -> URLRequest {
    |                 `- error: cannot find type 'URLRequest' in scope
106 |         var body: [String: JSONValue] = [
107 |             "model_name": .string(modelName),
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:17:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'KlingVideoModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 15 |     private let baseURL: URL
 16 |     private let headers: [String: String]
 17 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'KlingVideoModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 18 |     private let pollInterval: TimeInterval
 19 |     private let pollTimeout: TimeInterval
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:64:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 62 |         let route = Self.route(modelID, hasImage: request.image != nil)
 63 |         let endpoint = route.endpoint
 64 |         let (createData, createResponse) = try await urlSession.data(
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 65 |             for: try buildCreateRequest(request, endpoint: endpoint, modelName: route.apiModelName)
 66 |         )
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:79:24: error: cannot find 'URLRequest' in scope
 77 |             try await Task.sleep(nanoseconds: pollNanoseconds(pollInterval))
 78 |             if Date() > deadline { throw AIError.transport("Kling video generation timed out") }
 79 |             var poll = URLRequest(
    |                        `- error: cannot find 'URLRequest' in scope
 80 |                 url: baseURL.appendingPathComponent("v1/videos/\(endpoint)/\(taskID)")
 81 |             )
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:84:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 82 |             poll.setValue("Bearer \(try authToken())", forHTTPHeaderField: "Authorization")
 83 |             for (field, value) in headers { poll.setValue(value, forHTTPHeaderField: field) }
 84 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 85 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
 86 |             switch status["data"]?["task_status"]?.stringValue {
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:123:26: error: cannot find 'URLRequest' in scope
121 |         }
122 |
123 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent("v1/videos/\(endpoint)"))
    |                          `- error: cannot find 'URLRequest' in scope
124 |         urlRequest.httpMethod = "POST"
125 |         urlRequest.setValue("Bearer \(try authToken())", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/LMStudioModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = lmStudioConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/LMStudioModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = lmStudioConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:13:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |     private let baseURL: URL
 12 |     private let headers: [String: String]
 13 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 14 |
 15 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:20:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |         baseURL: URL = URL(string: "https://fal.run")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |     ) {
 22 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:20:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 18 |         baseURL: URL = URL(string: "https://fal.run")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 21 |     ) {
 22 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:52:66: error: cannot find type 'URLRequest' in scope
 50 |     }
 51 |
 52 |     func buildURLRequest(_ request: ImageModelRequest) throws -> URLRequest {
    |                                                                  `- error: cannot find type 'URLRequest' in scope
 53 |         var body: [String: JSONValue] = [
 54 |             "prompt": .string(request.prompt),
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:13:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'FalImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |     private let baseURL: URL
 12 |     private let headers: [String: String]
 13 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'FalImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 14 |
 15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:94:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         pollInterval: TimeInterval = 2,
 93 |         pollTimeout: TimeInterval = 300,
 94 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 95 |     ) {
 96 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:94:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         pollInterval: TimeInterval = 2,
 93 |         pollTimeout: TimeInterval = 300,
 94 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 95 |     ) {
 96 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:134:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
132 |         pollInterval: TimeInterval = 5,
133 |         pollTimeout: TimeInterval = 600,
134 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
135 |     ) {
136 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:134:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
132 |         pollInterval: TimeInterval = 5,
133 |         pollTimeout: TimeInterval = 600,
134 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
135 |     ) {
136 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:172:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
170 |     var pollInterval: TimeInterval
171 |     var pollTimeout: TimeInterval
172 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
173 |
174 |     func generate(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:172:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'LumaGenerationEngine' has non-sendable type 'URLSession' (aka 'AnyObject')
170 |     var pollInterval: TimeInterval
171 |     var pollTimeout: TimeInterval
172 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'LumaGenerationEngine' has non-sendable type 'URLSession' (aka 'AnyObject')
173 |
174 |     func generate(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:236:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
234 |     private let baseURL: URL
235 |     private let headers: [String: String]
236 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
237 |
238 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:243:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
241 |         baseURL: URL = URL(string: "https://api.replicate.com/v1")!,
242 |         headers: [String: String] = [:],
243 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
244 |     ) {
245 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:243:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
241 |         baseURL: URL = URL(string: "https://api.replicate.com/v1")!,
242 |         headers: [String: String] = [:],
243 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
244 |     ) {
245 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:279:66: error: cannot find type 'URLRequest' in scope
277 |     }
278 |
279 |     func buildURLRequest(_ request: ImageModelRequest) throws -> URLRequest {
    |                                                                  `- error: cannot find type 'URLRequest' in scope
280 |         var input: [String: JSONValue] = ["prompt": .string(request.prompt)]
281 |         if request.n > 1 { input["num_outputs"] = .number(Double(request.n)) }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:236:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'ReplicateImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
234 |     private let baseURL: URL
235 |     private let headers: [String: String]
236 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'ReplicateImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
237 |
238 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:33:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 31 |
 32 |     public func generateImages(_ request: ImageModelRequest) async throws -> ImageModelResponse {
 33 |         let (data, response) = try await urlSession.data(for: try buildURLRequest(request))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 34 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 35 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:39:29: error: value of type 'Any' has no subscripts
 37 |         let decoded = try JSONDecoder().decode(JSONValue.self, from: data)
 38 |         let urls = (decoded["images"]?.arrayValue ?? [])
 39 |             .compactMap { $0["url"]?.stringValue }
    |                             `- error: value of type 'Any' has no subscripts
 40 |             .compactMap(URL.init(string:))
 41 |         guard !urls.isEmpty else {
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:46:51: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 44 |         var images: [Data] = []
 45 |         for url in urls {
 46 |             let (bytes, _) = try await urlSession.data(from: url)
    |                                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 47 |             images.append(bytes)
 48 |         }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:71:26: error: cannot find 'URLRequest' in scope
 69 |         }
 70 |
 71 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent(modelID))
    |                          `- error: cannot find 'URLRequest' in scope
 72 |         urlRequest.httpMethod = "POST"
 73 |         urlRequest.setValue("Key \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:116:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
114 |             $0["assets"]?["image"]?.stringValue
115 |         }
116 |         let (bytes, _) = try await engine.urlSession.data(from: assetURL)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
117 |         return ImageModelResponse(images: [bytes])
118 |     }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:179:22: error: cannot find 'URLRequest' in scope
177 |         asset: @Sendable (JSONValue) -> String?
178 |     ) async throws -> URL {
179 |         var create = URLRequest(
    |                      `- error: cannot find 'URLRequest' in scope
180 |             url: baseURL.appendingPathComponent("dream-machine/v1/\(path)")
181 |         )
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:188:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
186 |         create.httpBody = try JSONEncoder().encode(body)
187 |
188 |         let (createData, createResponse) = try await urlSession.data(for: create)
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
189 |         if let http = createResponse as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
190 |             throw AIError.http(status: http.statusCode, body: String(decoding: createData, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:199:24: error: cannot find 'URLRequest' in scope
197 |             try await Task.sleep(nanoseconds: UInt64(pollInterval * 1_000_000_000))
198 |             if Date() > deadline { throw AIError.transport("Luma generation timed out") }
199 |             var poll = URLRequest(
    |                        `- error: cannot find 'URLRequest' in scope
200 |                 url: baseURL.appendingPathComponent("dream-machine/v1/generations/\(id)")
201 |             )
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:203:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
201 |             )
202 |             poll.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
203 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
204 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
205 |             if let assetURL = try Self.resolvePoll(status, asset: asset) { return assetURL }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:253:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
251 |
252 |     public func generateImages(_ request: ImageModelRequest) async throws -> ImageModelResponse {
253 |         let (data, response) = try await urlSession.data(for: try buildURLRequest(request))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
254 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
255 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:261:43: error: cannot infer key path type from context; consider explicitly specifying a root type
259 |         let urlStrings: [String]
260 |         if let array = output?.arrayValue {
261 |             urlStrings = array.compactMap(\.stringValue)
    |                                           `- error: cannot infer key path type from context; consider explicitly specifying a root type
262 |         } else if let single = output?.stringValue {
263 |             urlStrings = [single]
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:273:51: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
271 |         for urlString in urlStrings {
272 |             guard let url = URL(string: urlString) else { continue }
273 |             let (bytes, _) = try await urlSession.data(from: url)
    |                                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
274 |             images.append(bytes)
275 |         }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:298:26: error: cannot find 'URLRequest' in scope
296 |         }
297 |
298 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
299 |         urlRequest.httpMethod = "POST"
300 |         urlRequest.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:24:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 22 |         baseURL: URL = MetaModel.defaultBaseURL,
 23 |         headers: [String: String] = [:],
 24 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 25 |     ) {
 26 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:24:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 22 |         baseURL: URL = MetaModel.defaultBaseURL,
 23 |         headers: [String: String] = [:],
 24 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 25 |     ) {
 26 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:43:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 41 |         baseURL: URL = MetaModel.defaultBaseURL,
 42 |         headers: [String: String] = [:],
 43 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     ) -> MetaModel {
 45 |         MetaModel(modelID: modelID, chatEngine: OpenAIChatModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:43:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 41 |         baseURL: URL = MetaModel.defaultBaseURL,
 42 |         headers: [String: String] = [:],
 43 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     ) -> MetaModel {
 45 |         MetaModel(modelID: modelID, chatEngine: OpenAIChatModel(
/host/spi-builder-workspace/Sources/AI/Providers/MistralModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = mistralConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MistralModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = mistralConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/MoonshotModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = moonshotConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MoonshotModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = moonshotConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/OllamaModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = ollamaConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OllamaModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = ollamaConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleModelSupport.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         headers: [String: String],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) -> OpenAIChatModel {
19 |         OpenAIChatModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleModelSupport.swift:35:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
33 |         baseURL: URL?,
34 |         headers: [String: String],
35 |         urlSession: URLSession
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
36 |     ) -> OpenAIEmbeddingModel {
37 |         OpenAIEmbeddingModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
15 |         headers: [String: String] = [:],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
18 |     ) {
19 |         self.name = name
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:9:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 7 |     public var headers: [String: String]
 8 |     public var queryParams: [String: String]
 9 |     private let urlSession: URLSession
   |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
10 |
11 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         headers: [String: String] = [:],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) {
19 |         self.name = name
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:9:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'OpenAICompatibleProvider' has non-sendable type 'URLSession' (aka 'AnyObject')
 7 |     public var headers: [String: String]
 8 |     public var queryParams: [String: String]
 9 |     private let urlSession: URLSession
   |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'OpenAICompatibleProvider' has non-sendable type 'URLSession' (aka 'AnyObject')
10 |
11 |     public init(
[107/130] Compiling AI OpenAICompatibleProvider.swift
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 16 |         headers: [String: String] = [:],
 17 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     ) {
 19 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 15 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 16 |         headers: [String: String] = [:],
 17 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 18 |     ) {
 19 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:86:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 84 |         pollTimeout: Duration = .seconds(600),
 85 |         headers: [String: String] = [:],
 86 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 |     ) {
 88 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:86:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 84 |         pollTimeout: Duration = .seconds(600),
 85 |         headers: [String: String] = [:],
 86 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 87 |     ) {
 88 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:180:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
178 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
179 |         headers: [String: String] = [:],
180 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
181 |     ) {
182 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:180:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
178 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
179 |         headers: [String: String] = [:],
180 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
181 |     ) {
182 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:255:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
253 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
254 |         headers: [String: String] = [:],
255 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
256 |     ) {
257 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleMediaModels.swift:255:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
253 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
254 |         headers: [String: String] = [:],
255 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
256 |     ) {
257 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:13:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |     let baseURL: URL
 12 |     let headers: [String: String]
 13 |     let urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 14 |
 15 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:20:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |     ) {
 22 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:20:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 18 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 21 |     ) {
 22 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:38:23: error: cannot find type 'URLRequest' in scope
 36 |
 37 |     static func streamGenerateContent(
 38 |         _ urlRequest: URLRequest,
    |                       `- error: cannot find type 'URLRequest' in scope
 39 |         urlSession: URLSession
 40 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:39:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 37 |     static func streamGenerateContent(
 38 |         _ urlRequest: URLRequest,
 39 |         urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 40 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 41 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:123:69: error: cannot find type 'URLRequest' in scope
121 |     }
122 |
123 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
124 |         guard let url = URL(
125 |             string: "\(baseURL.absoluteString)/models/\(modelID):streamGenerateContent?alt=sse"
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:13:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |     let baseURL: URL
 12 |     let headers: [String: String]
 13 |     let urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 14 |
 15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:41:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 39 |         urlSession: URLSession
 40 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 41 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 42 |
 43 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
/host/spi-builder-workspace/Sources/AI/Streaming/SSE.swift:45:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
43 | enum SSE {
44 |     static func events(
45 |         from bytes: URLSession.AsyncBytes
   |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
46 |     ) -> AsyncThrowingStream<SSEEvent, Error> {
47 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/Providers/GoogleModel.swift:130:26: error: cannot find 'URLRequest' in scope
128 |         }
129 |
130 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
131 |         urlRequest.httpMethod = "POST"
132 |         urlRequest.setValue(apiKey, forHTTPHeaderField: "x-goog-api-key")
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:10:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  8 |     var baseURL: URL
  9 |     var headers: [String: String]
 10 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:12:80: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 10 |     var urlSession: URLSession
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
    |                                                                                `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 13 |         self.apiKey = apiKey
 14 |             ?? ProcessInfo.processInfo.environment["GOOGLE_GENERATIVE_AI_API_KEY"]
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:21:86: error: cannot find type 'URLRequest' in scope
 19 |     }
 20 |
 21 |     func request(_ method: String, _ path: String, query: [String: String] = [:]) -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
 22 |         // `path` is an absolute URL only when it came from a response — an
 23 |         // operation name or a file `uri`. Those live on the API host, so the
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:84:35: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 82 |     }
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
    |                                   `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
  |                  `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:10:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleHTTP' has non-sendable type 'URLSession' (aka 'AnyObject')
  8 |     var baseURL: URL
  9 |     var headers: [String: String]
 10 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleHTTP' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |
 12 |     init(apiKey: String?, baseURL: URL, headers: [String: String], urlSession: URLSession) {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:124:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
122 |         uploadBaseURL: URL = URL(string: "https://generativelanguage.googleapis.com/upload/v1beta")!,
123 |         headers: [String: String] = [:],
124 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
125 |     ) {
126 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:124:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
122 |         uploadBaseURL: URL = URL(string: "https://generativelanguage.googleapis.com/upload/v1beta")!,
123 |         headers: [String: String] = [:],
124 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
125 |     ) {
126 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:231:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
229 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
230 |         headers: [String: String] = [:],
231 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
232 |     ) {
233 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:231:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
229 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
230 |         headers: [String: String] = [:],
231 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
232 |     ) {
233 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:332:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
330 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
331 |         headers: [String: String] = [:],
332 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
333 |     ) {
334 |         self.http = GoogleHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:332:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
330 |         baseURL: URL = URL(string: "https://generativelanguage.googleapis.com/v1beta")!,
331 |         headers: [String: String] = [:],
332 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
333 |     ) {
334 |         self.http = GoogleHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:36:23: error: cannot find 'URLRequest' in scope
 34 |             url = components.url ?? base
 35 |         }
 36 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
 37 |         request.httpMethod = method
 38 |         if !apiKey.isEmpty, trusted {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:59:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 57 |             urlRequest.httpBody = try JSONEncoder().encode(json)
 58 |         }
 59 |         let (data, response) = try await urlSession.data(for: urlRequest)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 60 |         try Self.check(response, data)
 61 |         return data.isEmpty ? .object([:]) : try JSONDecoder().decode(JSONValue.self, from: data)
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:66:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 64 |     func download(_ path: String) async throws -> Data {
 65 |         try Self.checkAbsolute(path, baseURL: baseURL)
 66 |         let (data, response) = try await urlSession.data(for: request("GET", path))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 67 |         try Self.check(response, data)
 68 |         return data
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:32: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:36: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                    `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
  |                  `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:85:80: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 83 |
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                                                                `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 87 |         }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:86:45: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 84 |     static func check(_ response: URLResponse, _ data: Data) throws {
 85 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 86 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
    |                                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 87 |         }
 88 |     }
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:137:21: error: cannot find 'URLRequest' in scope
135 |         displayName: String? = nil
136 |     ) async throws -> GoogleFile {
137 |         var start = URLRequest(url: uploadBaseURL.appendingPathComponent("files"))
    |                     `- error: cannot find 'URLRequest' in scope
138 |         start.httpMethod = "POST"
139 |         if !http.apiKey.isEmpty {
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:152:68: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
150 |         start.httpBody = try JSONEncoder().encode(JSONValue.object(["file": .object(metadata)]))
151 |
152 |         let (startData, startResponse) = try await http.urlSession.data(for: start)
    |                                                                    `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
153 |         try GoogleHTTP.check(startResponse, startData)
154 |         guard let httpResponse = startResponse as? HTTPURLResponse,
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:162:22: error: cannot find 'URLRequest' in scope
160 |         }
161 |
162 |         var upload = URLRequest(url: uploadURL)
    |                      `- error: cannot find 'URLRequest' in scope
163 |         upload.httpMethod = "POST"
164 |         upload.setValue("\(data.count)", forHTTPHeaderField: "Content-Length")
/host/spi-builder-workspace/Sources/AI/Providers/GooglePlatformClients.swift:169:70: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
167 |         upload.httpBody = data
168 |
169 |         let (uploadData, uploadResponse) = try await http.urlSession.data(for: upload)
    |                                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
170 |         try GoogleHTTP.check(uploadResponse, uploadData)
171 |         let json = try JSONDecoder().decode(JSONValue.self, from: uploadData)
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:21:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     private let baseURL: URL?
 20 |     private let headers: [String: String]
 21 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 22 |
 23 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:31:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 32 |     ) {
 33 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:31:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:57:69: error: cannot find type 'URLRequest' in scope
 55 |     }
 56 |
 57 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
 58 |         let base = try resolvedBaseURL()
 59 |         guard let url = URL(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:21:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleVertexModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 19 |     private let baseURL: URL?
 20 |     private let headers: [String: String]
 21 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'GoogleVertexModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 22 |
 23 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/GoogleVertexModel.swift:65:26: error: cannot find 'URLRequest' in scope
 63 |         }
 64 |
 65 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
 66 |         urlRequest.httpMethod = "POST"
 67 |         switch auth {
/host/spi-builder-workspace/Sources/AI/Providers/GroqModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = groqConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/GroqModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = groqConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/HuggingFaceModel.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         baseURL: URL = URL(string: "https://router.huggingface.co/v1")!,
16 |         headers: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) {
19 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/HuggingFaceModel.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
15 |         baseURL: URL = URL(string: "https://router.huggingface.co/v1")!,
16 |         headers: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
18 |     ) {
19 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:17:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let baseURL: URL
 16 |     private let headers: [String: String]
 17 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     private let pollInterval: TimeInterval
 19 |     private let pollTimeout: TimeInterval
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:29:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 27 |         pollInterval: TimeInterval = 5,
 28 |         pollTimeout: TimeInterval = 600,
 29 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 30 |     ) {
 31 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:29:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 27 |         pollInterval: TimeInterval = 5,
 28 |         pollTimeout: TimeInterval = 600,
 29 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 30 |     ) {
 31 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:105:17: error: cannot find type 'URLRequest' in scope
103 |     func buildCreateRequest(
104 |         _ request: VideoModelRequest, endpoint: String, modelName: String
105 |     ) throws -> URLRequest {
    |                 `- error: cannot find type 'URLRequest' in scope
106 |         var body: [String: JSONValue] = [
107 |             "model_name": .string(modelName),
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:17:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'KlingVideoModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 15 |     private let baseURL: URL
 16 |     private let headers: [String: String]
 17 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'KlingVideoModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 18 |     private let pollInterval: TimeInterval
 19 |     private let pollTimeout: TimeInterval
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:64:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 62 |         let route = Self.route(modelID, hasImage: request.image != nil)
 63 |         let endpoint = route.endpoint
 64 |         let (createData, createResponse) = try await urlSession.data(
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 65 |             for: try buildCreateRequest(request, endpoint: endpoint, modelName: route.apiModelName)
 66 |         )
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:79:24: error: cannot find 'URLRequest' in scope
 77 |             try await Task.sleep(nanoseconds: pollNanoseconds(pollInterval))
 78 |             if Date() > deadline { throw AIError.transport("Kling video generation timed out") }
 79 |             var poll = URLRequest(
    |                        `- error: cannot find 'URLRequest' in scope
 80 |                 url: baseURL.appendingPathComponent("v1/videos/\(endpoint)/\(taskID)")
 81 |             )
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:84:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 82 |             poll.setValue("Bearer \(try authToken())", forHTTPHeaderField: "Authorization")
 83 |             for (field, value) in headers { poll.setValue(value, forHTTPHeaderField: field) }
 84 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 85 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
 86 |             switch status["data"]?["task_status"]?.stringValue {
/host/spi-builder-workspace/Sources/AI/Providers/KlingVideoModel.swift:123:26: error: cannot find 'URLRequest' in scope
121 |         }
122 |
123 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent("v1/videos/\(endpoint)"))
    |                          `- error: cannot find 'URLRequest' in scope
124 |         urlRequest.httpMethod = "POST"
125 |         urlRequest.setValue("Bearer \(try authToken())", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/LMStudioModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = lmStudioConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/LMStudioModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = lmStudioConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:13:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 11 |     private let baseURL: URL
 12 |     private let headers: [String: String]
 13 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 14 |
 15 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:20:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |         baseURL: URL = URL(string: "https://fal.run")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |     ) {
 22 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:20:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 18 |         baseURL: URL = URL(string: "https://fal.run")!,
 19 |         headers: [String: String] = [:],
 20 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 21 |     ) {
 22 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:52:66: error: cannot find type 'URLRequest' in scope
 50 |     }
 51 |
 52 |     func buildURLRequest(_ request: ImageModelRequest) throws -> URLRequest {
    |                                                                  `- error: cannot find type 'URLRequest' in scope
 53 |         var body: [String: JSONValue] = [
 54 |             "prompt": .string(request.prompt),
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:13:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'FalImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 11 |     private let baseURL: URL
 12 |     private let headers: [String: String]
 13 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'FalImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 14 |
 15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:94:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         pollInterval: TimeInterval = 2,
 93 |         pollTimeout: TimeInterval = 300,
 94 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 95 |     ) {
 96 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:94:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         pollInterval: TimeInterval = 2,
 93 |         pollTimeout: TimeInterval = 300,
 94 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 95 |     ) {
 96 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:134:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
132 |         pollInterval: TimeInterval = 5,
133 |         pollTimeout: TimeInterval = 600,
134 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
135 |     ) {
136 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:134:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
132 |         pollInterval: TimeInterval = 5,
133 |         pollTimeout: TimeInterval = 600,
134 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
135 |     ) {
136 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:172:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
170 |     var pollInterval: TimeInterval
171 |     var pollTimeout: TimeInterval
172 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
173 |
174 |     func generate(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:172:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'LumaGenerationEngine' has non-sendable type 'URLSession' (aka 'AnyObject')
170 |     var pollInterval: TimeInterval
171 |     var pollTimeout: TimeInterval
172 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'LumaGenerationEngine' has non-sendable type 'URLSession' (aka 'AnyObject')
173 |
174 |     func generate(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:236:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
234 |     private let baseURL: URL
235 |     private let headers: [String: String]
236 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
237 |
238 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:243:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
241 |         baseURL: URL = URL(string: "https://api.replicate.com/v1")!,
242 |         headers: [String: String] = [:],
243 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
244 |     ) {
245 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:243:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
241 |         baseURL: URL = URL(string: "https://api.replicate.com/v1")!,
242 |         headers: [String: String] = [:],
243 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
244 |     ) {
245 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:279:66: error: cannot find type 'URLRequest' in scope
277 |     }
278 |
279 |     func buildURLRequest(_ request: ImageModelRequest) throws -> URLRequest {
    |                                                                  `- error: cannot find type 'URLRequest' in scope
280 |         var input: [String: JSONValue] = ["prompt": .string(request.prompt)]
281 |         if request.n > 1 { input["num_outputs"] = .number(Double(request.n)) }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:236:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'ReplicateImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
234 |     private let baseURL: URL
235 |     private let headers: [String: String]
236 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'ReplicateImageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
237 |
238 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:33:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 31 |
 32 |     public func generateImages(_ request: ImageModelRequest) async throws -> ImageModelResponse {
 33 |         let (data, response) = try await urlSession.data(for: try buildURLRequest(request))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 34 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 35 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:39:29: error: value of type 'Any' has no subscripts
 37 |         let decoded = try JSONDecoder().decode(JSONValue.self, from: data)
 38 |         let urls = (decoded["images"]?.arrayValue ?? [])
 39 |             .compactMap { $0["url"]?.stringValue }
    |                             `- error: value of type 'Any' has no subscripts
 40 |             .compactMap(URL.init(string:))
 41 |         guard !urls.isEmpty else {
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:46:51: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 44 |         var images: [Data] = []
 45 |         for url in urls {
 46 |             let (bytes, _) = try await urlSession.data(from: url)
    |                                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 47 |             images.append(bytes)
 48 |         }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:71:26: error: cannot find 'URLRequest' in scope
 69 |         }
 70 |
 71 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent(modelID))
    |                          `- error: cannot find 'URLRequest' in scope
 72 |         urlRequest.httpMethod = "POST"
 73 |         urlRequest.setValue("Key \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:116:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
114 |             $0["assets"]?["image"]?.stringValue
115 |         }
116 |         let (bytes, _) = try await engine.urlSession.data(from: assetURL)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
117 |         return ImageModelResponse(images: [bytes])
118 |     }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:179:22: error: cannot find 'URLRequest' in scope
177 |         asset: @Sendable (JSONValue) -> String?
178 |     ) async throws -> URL {
179 |         var create = URLRequest(
    |                      `- error: cannot find 'URLRequest' in scope
180 |             url: baseURL.appendingPathComponent("dream-machine/v1/\(path)")
181 |         )
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:188:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
186 |         create.httpBody = try JSONEncoder().encode(body)
187 |
188 |         let (createData, createResponse) = try await urlSession.data(for: create)
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
189 |         if let http = createResponse as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
190 |             throw AIError.http(status: http.statusCode, body: String(decoding: createData, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:199:24: error: cannot find 'URLRequest' in scope
197 |             try await Task.sleep(nanoseconds: UInt64(pollInterval * 1_000_000_000))
198 |             if Date() > deadline { throw AIError.transport("Luma generation timed out") }
199 |             var poll = URLRequest(
    |                        `- error: cannot find 'URLRequest' in scope
200 |                 url: baseURL.appendingPathComponent("dream-machine/v1/generations/\(id)")
201 |             )
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:203:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
201 |             )
202 |             poll.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
203 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
204 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
205 |             if let assetURL = try Self.resolvePoll(status, asset: asset) { return assetURL }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:253:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
251 |
252 |     public func generateImages(_ request: ImageModelRequest) async throws -> ImageModelResponse {
253 |         let (data, response) = try await urlSession.data(for: try buildURLRequest(request))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
254 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
255 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:261:43: error: cannot infer key path type from context; consider explicitly specifying a root type
259 |         let urlStrings: [String]
260 |         if let array = output?.arrayValue {
261 |             urlStrings = array.compactMap(\.stringValue)
    |                                           `- error: cannot infer key path type from context; consider explicitly specifying a root type
262 |         } else if let single = output?.stringValue {
263 |             urlStrings = [single]
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:273:51: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
271 |         for urlString in urlStrings {
272 |             guard let url = URL(string: urlString) else { continue }
273 |             let (bytes, _) = try await urlSession.data(from: url)
    |                                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
274 |             images.append(bytes)
275 |         }
/host/spi-builder-workspace/Sources/AI/Providers/MediaGenerationPacks.swift:298:26: error: cannot find 'URLRequest' in scope
296 |         }
297 |
298 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
299 |         urlRequest.httpMethod = "POST"
300 |         urlRequest.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:24:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 22 |         baseURL: URL = MetaModel.defaultBaseURL,
 23 |         headers: [String: String] = [:],
 24 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 25 |     ) {
 26 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:24:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 22 |         baseURL: URL = MetaModel.defaultBaseURL,
 23 |         headers: [String: String] = [:],
 24 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 25 |     ) {
 26 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:43:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 41 |         baseURL: URL = MetaModel.defaultBaseURL,
 42 |         headers: [String: String] = [:],
 43 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     ) -> MetaModel {
 45 |         MetaModel(modelID: modelID, chatEngine: OpenAIChatModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MetaModel.swift:43:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 41 |         baseURL: URL = MetaModel.defaultBaseURL,
 42 |         headers: [String: String] = [:],
 43 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     ) -> MetaModel {
 45 |         MetaModel(modelID: modelID, chatEngine: OpenAIChatModel(
/host/spi-builder-workspace/Sources/AI/Providers/MistralModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = mistralConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MistralModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = mistralConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/MoonshotModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = moonshotConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/MoonshotModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = moonshotConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/OllamaModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = ollamaConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OllamaModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = ollamaConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleModelSupport.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         headers: [String: String],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) -> OpenAIChatModel {
19 |         OpenAIChatModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleModelSupport.swift:35:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
33 |         baseURL: URL?,
34 |         headers: [String: String],
35 |         urlSession: URLSession
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
36 |     ) -> OpenAIEmbeddingModel {
37 |         OpenAIEmbeddingModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:17:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
15 |         headers: [String: String] = [:],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
18 |     ) {
19 |         self.name = name
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:9:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 7 |     public var headers: [String: String]
 8 |     public var queryParams: [String: String]
 9 |     private let urlSession: URLSession
   |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
10 |
11 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:17:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
15 |         headers: [String: String] = [:],
16 |         queryParams: [String: String] = [:],
17 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
18 |     ) {
19 |         self.name = name
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/OpenAICompatibleProvider.swift:9:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'OpenAICompatibleProvider' has non-sendable type 'URLSession' (aka 'AnyObject')
 7 |     public var headers: [String: String]
 8 |     public var queryParams: [String: String]
 9 |     private let urlSession: URLSession
   |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'OpenAICompatibleProvider' has non-sendable type 'URLSession' (aka 'AnyObject')
10 |
11 |     public init(
[108/130] Compiling AI AIError.swift
[109/130] Compiling AI Agent.swift
[110/130] Compiling AI Compaction.swift
[111/130] Compiling AI Embeddings.swift
[112/130] Compiling AI GenerateObject.swift
[113/130] Compiling AI GenerateText.swift
[114/130] Compiling AI ImageGeneration.swift
[115/130] Compiling AI LanguageModel.swift
[116/130] Compiling AI Message.swift
[117/130] Compiling AI Middleware.swift
[118/130] Compiling AI ModelContextWindows.swift
[119/130] Compiling AI ModelMiddleware.swift
[120/130] Compiling AI ProviderDefinedTool.swift
[121/130] Compiling AI ProviderRegistry.swift
[122/130] Compiling AI PruneMessages.swift
BUILD FAILURE 6.1 wasm