The Swift Package Index logo.Swift Package Index

Build Information

Failed to build OpenAIKit, reference master (0cbfa4), with Swift 6.3 for Wasm on 16 Apr 2026 13:21:04 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4606859-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/swiftpackageindex/spi-images:wasm-6.3-latest swift build --swift-sdk swift-6.3-RELEASE_wasm 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.70.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/guitaripod/OpenAIKit.git
Reference: master
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
From https://github.com/guitaripod/OpenAIKit
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> origin/master
HEAD is now at 0cbfa40 Update GitHub username from marcusziade to guitaripod
Cloned https://github.com/guitaripod/OpenAIKit.git
Revision (git rev-parse @):
0cbfa403b977867559b8fc566e352e681f1bd845
SUCCESS checkout https://github.com/guitaripod/OpenAIKit.git at master
========================================
Build
========================================
Selected platform:         wasm
Swift version:             6.3
Building package at path:  $PWD
https://github.com/guitaripod/OpenAIKit.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/swiftpackageindex/spi-images:wasm-6.3-latest swift build --swift-sdk swift-6.3-RELEASE_wasm 2>&1
wasm-6.3-latest: Pulling from swiftpackageindex/spi-images
Digest: sha256:d69f4e7582c319245442d62a08b2d7c7fd5a0c0c69f5d2ef11d1530cd8d3329b
Status: Image is up to date for registry.gitlab.com/swiftpackageindex/spi-images:wasm-6.3-latest
Fetching https://github.com/apple/swift-docc-plugin
[1/2277] Fetching swift-docc-plugin
Fetched https://github.com/apple/swift-docc-plugin from cache (1.31s)
Computing version for https://github.com/apple/swift-docc-plugin
Computed https://github.com/apple/swift-docc-plugin at 1.4.6 (5.13s)
Fetching https://github.com/swiftlang/swift-docc-symbolkit
[1/3672] Fetching swift-docc-symbolkit
Fetched https://github.com/swiftlang/swift-docc-symbolkit from cache (0.54s)
Computing version for https://github.com/swiftlang/swift-docc-symbolkit
Computed https://github.com/swiftlang/swift-docc-symbolkit at 1.0.0 (1.57s)
Creating working copy for https://github.com/swiftlang/swift-docc-symbolkit
Working copy of https://github.com/swiftlang/swift-docc-symbolkit resolved at 1.0.0
Creating working copy for https://github.com/apple/swift-docc-plugin
Working copy of https://github.com/apple/swift-docc-plugin resolved at 1.4.6
[1/1] Compiling plugin Swift-DocC Preview
[2/2] Compiling plugin Swift-DocC
Building for debugging...
[2/9] Write sources
[4/9] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[6/38] Emitting module OpenAIKit
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
 13 |
 14 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let configuration: Configuration
 16 |     private let decoder: JSONDecoder
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/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 |     }
245 |
246 |     private func buildURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                             `- error: cannot find type 'URLRequest' in scope
247 |         let url = configuration.baseURL
248 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 |     }
265 |
266 |     private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
267 |         var urlRequest = try await buildURLRequest(from: request)
268 |         urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 |     }
271 |
272 |     private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
    |                                                                                         `- error: cannot find type 'URLRequest' in scope
273 |         let url = configuration.baseURL
274 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 |     }
289 |
290 |     private func configureHeaders(_ request: inout URLRequest) {
    |                                                    `- error: cannot find type 'URLRequest' in scope
291 |         request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 |     }
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
    |                                               `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 |         guard let httpResponse = response as? HTTPURLResponse else {
306 |             throw OpenAIError.invalidResponse
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
[7/41] Compiling OpenAIKit ChatEndpoint.swift
[8/41] Compiling OpenAIKit EmbeddingsEndpoint.swift
[9/41] Compiling OpenAIKit FilesEndpoint.swift
[10/41] Compiling OpenAIKit FineTuningEndpoint.swift
[11/41] Compiling OpenAIKit Responses.swift
[12/41] Compiling OpenAIKit OpenAIKit.swift
[13/41] Compiling OpenAIKit JSONValue.swift
[14/41] Compiling OpenAIKit Images.swift
[15/41] Compiling OpenAIKit ModelConstants.swift
[16/41] Compiling OpenAIKit Models.swift
[17/41] Compiling OpenAIKit Moderations.swift
[18/41] Compiling OpenAIKit NetworkClient.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
 13 |
 14 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let configuration: Configuration
 16 |     private let decoder: JSONDecoder
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/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 |     }
245 |
246 |     private func buildURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                             `- error: cannot find type 'URLRequest' in scope
247 |         let url = configuration.baseURL
248 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 |     }
265 |
266 |     private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
267 |         var urlRequest = try await buildURLRequest(from: request)
268 |         urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 |     }
271 |
272 |     private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
    |                                                                                         `- error: cannot find type 'URLRequest' in scope
273 |         let url = configuration.baseURL
274 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 |     }
289 |
290 |     private func configureHeaders(_ request: inout URLRequest) {
    |                                                    `- error: cannot find type 'URLRequest' in scope
291 |         request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 |     }
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
    |                                               `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 |         guard let httpResponse = response as? HTTPURLResponse else {
306 |             throw OpenAIError.invalidResponse
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/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 19 |         self.configuration = configuration
 20 |
 21 |         let sessionConfiguration = URLSessionConfiguration.default
    |                                                            `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
 24 |         self.session = URLSession(configuration: sessionConfiguration)
    |                        `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 25 |
 26 |         self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 69 |         #else
 70 |         // macOS/iOS implementation
 71 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 72 |
 73 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 |         #else
230 |         // macOS/iOS implementation
231 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 |             .appendingPathComponent(request.path)
250 |
251 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
252 |         urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 |             .appendingPathComponent(request.path)
276 |
277 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
278 |         urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                           `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 |             throw OpenAIError.invalidResponse
307 |         }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                               `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 |             throw OpenAIError.invalidResponse
307 |         }
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/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 |         }
308 |
309 |         switch httpResponse.statusCode {
    |                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 |         case 200...299:
311 |             return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 |                 throw OpenAIError.apiError(apiError)
327 |             }
328 |             throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 |         case 500...599:
330 |             // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 |                 throw OpenAIError.apiError(apiError)
333 |             }
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
    |                                                                     `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 |         }
338 |     }
[19/41] Compiling OpenAIKit OpenAIError.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
 13 |
 14 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let configuration: Configuration
 16 |     private let decoder: JSONDecoder
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/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 |     }
245 |
246 |     private func buildURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                             `- error: cannot find type 'URLRequest' in scope
247 |         let url = configuration.baseURL
248 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 |     }
265 |
266 |     private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
267 |         var urlRequest = try await buildURLRequest(from: request)
268 |         urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 |     }
271 |
272 |     private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
    |                                                                                         `- error: cannot find type 'URLRequest' in scope
273 |         let url = configuration.baseURL
274 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 |     }
289 |
290 |     private func configureHeaders(_ request: inout URLRequest) {
    |                                                    `- error: cannot find type 'URLRequest' in scope
291 |         request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 |     }
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
    |                                               `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 |         guard let httpResponse = response as? HTTPURLResponse else {
306 |             throw OpenAIError.invalidResponse
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/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 19 |         self.configuration = configuration
 20 |
 21 |         let sessionConfiguration = URLSessionConfiguration.default
    |                                                            `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
 24 |         self.session = URLSession(configuration: sessionConfiguration)
    |                        `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 25 |
 26 |         self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 69 |         #else
 70 |         // macOS/iOS implementation
 71 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 72 |
 73 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 |         #else
230 |         // macOS/iOS implementation
231 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 |             .appendingPathComponent(request.path)
250 |
251 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
252 |         urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 |             .appendingPathComponent(request.path)
276 |
277 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
278 |         urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                           `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 |             throw OpenAIError.invalidResponse
307 |         }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                               `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 |             throw OpenAIError.invalidResponse
307 |         }
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/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 |         }
308 |
309 |         switch httpResponse.statusCode {
    |                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 |         case 200...299:
311 |             return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 |                 throw OpenAIError.apiError(apiError)
327 |             }
328 |             throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 |         case 500...599:
330 |             // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 |                 throw OpenAIError.apiError(apiError)
333 |             }
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
    |                                                                     `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 |         }
338 |     }
[20/41] Compiling OpenAIKit Request.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
 13 |
 14 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let configuration: Configuration
 16 |     private let decoder: JSONDecoder
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/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 |     }
245 |
246 |     private func buildURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                             `- error: cannot find type 'URLRequest' in scope
247 |         let url = configuration.baseURL
248 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 |     }
265 |
266 |     private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
267 |         var urlRequest = try await buildURLRequest(from: request)
268 |         urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 |     }
271 |
272 |     private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
    |                                                                                         `- error: cannot find type 'URLRequest' in scope
273 |         let url = configuration.baseURL
274 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 |     }
289 |
290 |     private func configureHeaders(_ request: inout URLRequest) {
    |                                                    `- error: cannot find type 'URLRequest' in scope
291 |         request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 |     }
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
    |                                               `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 |         guard let httpResponse = response as? HTTPURLResponse else {
306 |             throw OpenAIError.invalidResponse
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/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 19 |         self.configuration = configuration
 20 |
 21 |         let sessionConfiguration = URLSessionConfiguration.default
    |                                                            `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
 24 |         self.session = URLSession(configuration: sessionConfiguration)
    |                        `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 25 |
 26 |         self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 69 |         #else
 70 |         // macOS/iOS implementation
 71 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 72 |
 73 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 |         #else
230 |         // macOS/iOS implementation
231 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 |             .appendingPathComponent(request.path)
250 |
251 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
252 |         urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 |             .appendingPathComponent(request.path)
276 |
277 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
278 |         urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                           `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 |             throw OpenAIError.invalidResponse
307 |         }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                               `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 |             throw OpenAIError.invalidResponse
307 |         }
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/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 |         }
308 |
309 |         switch httpResponse.statusCode {
    |                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 |         case 200...299:
311 |             return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 |                 throw OpenAIError.apiError(apiError)
327 |             }
328 |             throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 |         case 500...599:
330 |             // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 |                 throw OpenAIError.apiError(apiError)
333 |             }
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
    |                                                                     `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 |         }
338 |     }
[21/41] Compiling OpenAIKit RetryHandler.swift
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:14:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 | public final class NetworkClient: NetworkClientProtocol, @unchecked Sendable {
 13 |
 14 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |     private let configuration: Configuration
 16 |     private let decoder: JSONDecoder
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/OpenAIKit/Core/NetworkClient.swift:246:77: error: cannot find type 'URLRequest' in scope
244 |     }
245 |
246 |     private func buildURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                             `- error: cannot find type 'URLRequest' in scope
247 |         let url = configuration.baseURL
248 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:266:86: error: cannot find type 'URLRequest' in scope
264 |     }
265 |
266 |     private func buildStreamingURLRequest(from request: any Request) async throws -> URLRequest {
    |                                                                                      `- error: cannot find type 'URLRequest' in scope
267 |         var urlRequest = try await buildURLRequest(from: request)
268 |         urlRequest.setValue("text/event-stream", forHTTPHeaderField: "Accept")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:272:89: error: cannot find type 'URLRequest' in scope
270 |     }
271 |
272 |     private func buildUploadURLRequest(from request: any UploadRequest) async throws -> URLRequest {
    |                                                                                         `- error: cannot find type 'URLRequest' in scope
273 |         let url = configuration.baseURL
274 |             .appendingPathComponent("v1")
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:290:52: error: cannot find type 'URLRequest' in scope
288 |     }
289 |
290 |     private func configureHeaders(_ request: inout URLRequest) {
    |                                                    `- error: cannot find type 'URLRequest' in scope
291 |         request.setValue("Bearer \(configuration.apiKey)", forHTTPHeaderField: "Authorization")
292 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:304:47: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
302 |     }
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
    |                                               `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
305 |         guard let httpResponse = response as? HTTPURLResponse else {
306 |             throw OpenAIError.invalidResponse
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/OpenAIKit/Core/NetworkClient.swift:21:60: error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 19 |         self.configuration = configuration
 20 |
 21 |         let sessionConfiguration = URLSessionConfiguration.default
    |                                                            `- error: type 'URLSessionConfiguration' (aka 'AnyObject') has no member 'default'
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:24:24: error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 22 |         sessionConfiguration.timeoutIntervalForRequest = configuration.timeoutInterval
 23 |         sessionConfiguration.timeoutIntervalForResource = configuration.timeoutInterval * 2
 24 |         self.session = URLSession(configuration: sessionConfiguration)
    |                        `- error: 'URLSession' (aka 'AnyObject') cannot be constructed because it has no accessible initializers
 25 |
 26 |         self.decoder = JSONDecoder()
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:71:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 69 |         #else
 70 |         // macOS/iOS implementation
 71 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 72 |
 73 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:231:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
229 |         #else
230 |         // macOS/iOS implementation
231 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
232 |
233 |         try validateResponse(response, data: data)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:251:26: error: cannot find 'URLRequest' in scope
249 |             .appendingPathComponent(request.path)
250 |
251 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
252 |         urlRequest.httpMethod = request.method.rawValue
253 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:277:26: error: cannot find 'URLRequest' in scope
275 |             .appendingPathComponent(request.path)
276 |
277 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
278 |         urlRequest.httpMethod = "POST"
279 |
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:43: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                           `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
306 |             throw OpenAIError.invalidResponse
307 |         }
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:305:47: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
303 |
304 |     private func validateResponse(_ response: URLResponse, data: Data?) throws {
305 |         guard let httpResponse = response as? HTTPURLResponse else {
    |                                               `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
306 |             throw OpenAIError.invalidResponse
307 |         }
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/OpenAIKit/Core/NetworkClient.swift:309:29: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
307 |         }
308 |
309 |         switch httpResponse.statusCode {
    |                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
310 |         case 200...299:
311 |             return
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:328:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
326 |                 throw OpenAIError.apiError(apiError)
327 |             }
328 |             throw OpenAIError.clientError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
329 |         case 500...599:
330 |             // Even server errors might have API error details
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:334:68: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
332 |                 throw OpenAIError.apiError(apiError)
333 |             }
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
    |                                                                    `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
/host/spi-builder-workspace/Sources/OpenAIKit/Core/NetworkClient.swift:336:69: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
334 |             throw OpenAIError.serverError(statusCode: httpResponse.statusCode)
335 |         default:
336 |             throw OpenAIError.unknownError(statusCode: httpResponse.statusCode)
    |                                                                     `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
337 |         }
338 |     }
[22/41] Compiling OpenAIKit ThreadsEndpoint.swift
[23/41] Compiling OpenAIKit VectorStoresEndpoint.swift
[24/41] Compiling OpenAIKit OpenAIError+UI.swift
[25/41] Compiling OpenAIKit Audio.swift
[26/41] Compiling OpenAIKit AssistantsEndpoint.swift
[27/41] Compiling OpenAIKit AudioEndpoint.swift
[28/41] Compiling OpenAIKit BatchEndpoint.swift
[29/41] Compiling OpenAIKit BatchesEndpoint.swift
[30/41] Compiling OpenAIKit Batch.swift
[31/41] Compiling OpenAIKit Chat.swift
[32/41] Compiling OpenAIKit Embeddings.swift
[33/41] Compiling OpenAIKit Files.swift
[34/41] Compiling OpenAIKit ImagesEndpoint.swift
[35/41] Compiling OpenAIKit ModelsEndpoint.swift
[36/41] Compiling OpenAIKit ModerationsEndpoint.swift
[37/41] Compiling OpenAIKit ResponsesEndpoint.swift
BUILD FAILURE 6.3 wasm