The Swift Package Index logo.Swift Package Index

Build Information

Failed to build FoundationModelsKit, reference main (691a96), with Swift 6.1 for Android on 12 Oct 2026 08:52:02 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-54344843-3":/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:android-6.1-latest swift build --swift-sdk aarch64-unknown-linux-android24 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 5.1.1
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/divyaravitech/FoundationModelsKit.git
Reference: main
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/divyaravitech/FoundationModelsKit
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 691a965 Rename sendMessage/streamMessage to respond(to:)/streamResponse(to:)
Cloned https://github.com/divyaravitech/FoundationModelsKit.git
Revision (git rev-parse @):
691a965deafc558fde738f2175766ac7eaea62f9
SPI manifest file found: $PWD/.spi.yml
SUCCESS checkout https://github.com/divyaravitech/FoundationModelsKit.git at main
========================================
Build
========================================
Selected platform:         android
Swift version:             6.1
Building package at path:  $PWD
https://github.com/divyaravitech/FoundationModelsKit.git
https://github.com/divyaravitech/FoundationModelsKit.git
WARNING: environment variable SUPPRESS_SWIFT_6_FLAGS is not set
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-54344843-3":/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:android-6.1-latest swift build --swift-sdk aarch64-unknown-linux-android24 -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures 2>&1
android-6.1-latest: Pulling from saguaro1/spi-images
Digest: sha256:396310cef4466ceb116ed5462b0b92d4deb353c0dad749b406b7fd226f6db9af
Status: Image is up to date for registry.gitlab.com/saguaro1/spi-images:android-6.1-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/17] Compiling FoundationModelsKit MockLanguageModel.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
[4/17] Compiling FoundationModelsKit ModelRouter.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
[5/17] Compiling FoundationModelsKit GeminiLanguageModel.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:92:81: error: cannot find type 'URLRequest' in scope
 90 |     }
 91 |
 92 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 93 |         let method = stream ? "streamGenerateContent" : "generateContent"
 94 |         var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 |     }
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:106:26: error: cannot find 'URLRequest' in scope
104 |         }
105 |
106 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
107 |         urlRequest.httpMethod = "POST"
108 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/GeminiLanguageModel.swift:118:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
119 |             if Self.isTransient(statusCode: http.statusCode) {
120 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:119:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 |                 throw LanguageModelError.unavailable
121 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:123:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 |             }
122 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
123 |             throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
124 |         }
125 |     }
[6/17] Compiling FoundationModelsKit LanguageModelProviding.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:92:81: error: cannot find type 'URLRequest' in scope
 90 |     }
 91 |
 92 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 93 |         let method = stream ? "streamGenerateContent" : "generateContent"
 94 |         var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 |     }
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:106:26: error: cannot find 'URLRequest' in scope
104 |         }
105 |
106 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
107 |         urlRequest.httpMethod = "POST"
108 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/GeminiLanguageModel.swift:118:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
119 |             if Self.isTransient(statusCode: http.statusCode) {
120 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:119:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 |                 throw LanguageModelError.unavailable
121 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:123:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 |             }
122 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
123 |             throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
124 |         }
125 |     }
[7/19] Compiling FoundationModelsKit RetryPolicy.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
[8/19] Compiling FoundationModelsKit SDKIntegration.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
error: emit-module command failed with exit code 1 (use -v to see invocation)
[9/19] Emitting module FoundationModelsKit
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 71 |     private let tools: ToolRegistry
 72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                  `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 81 |     ) {
 82 |         self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                                `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 81 |     ) {
 82 |         self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:166:81: error: cannot find type 'URLRequest' in scope
164 |     // MARK: - Private helpers
165 |
166 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
167 |         try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 |     }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 |     }
169 |
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 |     }
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 71 |     private let tools: ToolRegistry
 72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:92:81: error: cannot find type 'URLRequest' in scope
 90 |     }
 91 |
 92 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 93 |         let method = stream ? "streamGenerateContent" : "generateContent"
 94 |         var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 |     }
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
 91 |     }
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
 95 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 |     }
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         self.config = config
 93 |         self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                                        `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         self.config = config
 93 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
[10/19] Compiling FoundationModelsKit DynamicProfileBuilder.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
[11/19] Compiling FoundationModelsKit EvaluationSuite.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
[12/19] Compiling FoundationModelsKit OnDeviceLanguageModel.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
[13/19] Compiling FoundationModelsKit OnDeviceToolBridge.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
[14/19] Compiling FoundationModelsKit OpenAILanguageModel.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
 91 |     }
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
 95 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 |     }
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:94:26: error: cannot find 'URLRequest' in scope
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
    |                          `- error: cannot find 'URLRequest' in scope
 95 |         urlRequest.httpMethod = "POST"
 96 |         urlRequest.setValue("Bearer \(config.apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/OpenAILanguageModel.swift:112:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
113 |             if Self.isTransient(statusCode: http.statusCode) {
114 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:113:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
114 |                 throw LanguageModelError.unavailable
115 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:117:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
115 |             }
116 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
117 |             throw OpenAIError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 |         }
119 |     }
[15/19] Compiling FoundationModelsKit RegionalAvailability.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
 91 |     }
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
 95 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 |     }
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:94:26: error: cannot find 'URLRequest' in scope
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
    |                          `- error: cannot find 'URLRequest' in scope
 95 |         urlRequest.httpMethod = "POST"
 96 |         urlRequest.setValue("Bearer \(config.apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/OpenAILanguageModel.swift:112:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
113 |             if Self.isTransient(statusCode: http.statusCode) {
114 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:113:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
114 |                 throw LanguageModelError.unavailable
115 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:117:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
115 |             }
116 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
117 |             throw OpenAIError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 |         }
119 |     }
[16/19] Compiling FoundationModelsKit AnthropicLanguageModel.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 71 |     private let tools: ToolRegistry
 72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                  `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 81 |     ) {
 82 |         self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                                `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 81 |     ) {
 82 |         self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:166:81: error: cannot find type 'URLRequest' in scope
164 |     // MARK: - Private helpers
165 |
166 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
167 |         try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 |     }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 |     }
169 |
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 |     }
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 71 |     private let tools: ToolRegistry
 72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:95:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 93 |         for _ in 0..<Self.maxToolTurns {
 94 |             let urlRequest = try makeRequest(messages: messages, stream: false)
 95 |             let (data, response) = try await session.data(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 96 |             try validate(response: response, data: data)
 97 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:172:26: error: cannot find 'URLRequest' in scope
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
173 |         urlRequest.httpMethod = "POST"
174 |         urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/AnthropicLanguageModel.swift:214:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
215 |             if Self.isTransient(statusCode: http.statusCode) {
216 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:215:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 |                 throw LanguageModelError.unavailable
217 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:220:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
218 |             // Client error: retrying would resend the same bad request.
219 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
220 |             throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
    |                                                            `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
221 |         }
222 |     }
[17/19] Compiling FoundationModelsKit ConversationStore.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 71 |     private let tools: ToolRegistry
 72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                  `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 81 |     ) {
 82 |         self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                                `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 81 |     ) {
 82 |         self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:166:81: error: cannot find type 'URLRequest' in scope
164 |     // MARK: - Private helpers
165 |
166 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
167 |         try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 |     }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 |     }
169 |
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 |     }
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 71 |     private let tools: ToolRegistry
 72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:95:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 93 |         for _ in 0..<Self.maxToolTurns {
 94 |             let urlRequest = try makeRequest(messages: messages, stream: false)
 95 |             let (data, response) = try await session.data(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 96 |             try validate(response: response, data: data)
 97 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:172:26: error: cannot find 'URLRequest' in scope
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
173 |         urlRequest.httpMethod = "POST"
174 |         urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/AnthropicLanguageModel.swift:214:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
215 |             if Self.isTransient(statusCode: http.statusCode) {
216 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:215:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 |                 throw LanguageModelError.unavailable
217 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:220:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
218 |             // Client error: retrying would resend the same bad request.
219 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
220 |             throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
    |                                                            `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
221 |         }
222 |     }
[18/19] Compiling FoundationModelsKit TokenEstimator.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         self.config = config
 93 |         self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                                        `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         self.config = config
 93 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:97:23: error: cannot find 'URLRequest' in scope
 95 |
 96 |     public func exactTokenCount(of text: String) async throws -> Int {
 97 |         var request = URLRequest(url: config.baseURL.appendingPathComponent("v1/messages/count_tokens"))
    |                       `- error: cannot find 'URLRequest' in scope
 98 |         request.httpMethod = "POST"
 99 |         request.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:107:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
105 |         ])
106 |
107 |         let (data, response) = try await session.data(for: request)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
108 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
109 |             throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:20: error: cannot find 'CFGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                    `- error: cannot find 'CFGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:38: error: cannot find 'CFBooleanGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                                      `- error: cannot find 'CFBooleanGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
[19/19] Compiling FoundationModelsKit Tool.swift
<unknown>:0: warning: upcoming feature 'InferSendableFromCaptures' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'GlobalActorIsolatedTypesUsability' is already enabled as of Swift version 6
<unknown>:0: warning: upcoming feature 'DisableOutwardActorInference' is already enabled as of Swift version 6
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         self.config = config
 93 |         self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                                        `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         self.config = config
 93 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:97:23: error: cannot find 'URLRequest' in scope
 95 |
 96 |     public func exactTokenCount(of text: String) async throws -> Int {
 97 |         var request = URLRequest(url: config.baseURL.appendingPathComponent("v1/messages/count_tokens"))
    |                       `- error: cannot find 'URLRequest' in scope
 98 |         request.httpMethod = "POST"
 99 |         request.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:107:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
105 |         ])
106 |
107 |         let (data, response) = try await session.data(for: request)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
108 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
109 |             throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:20: error: cannot find 'CFGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                    `- error: cannot find 'CFGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:38: error: cannot find 'CFBooleanGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                                      `- error: cannot find 'CFBooleanGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-54344843-3":/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:android-6.1-latest swift build --swift-sdk aarch64-unknown-linux-android24 2>&1
android-6.1-latest: Pulling from saguaro1/spi-images
Digest: sha256:396310cef4466ceb116ed5462b0b92d4deb353c0dad749b406b7fd226f6db9af
Status: Image is up to date for registry.gitlab.com/saguaro1/spi-images:android-6.1-latest
[0/1] Planning build
Building for debugging...
[0/1] Write swift-version-24593BA9C3E375BF.txt
[2/16] Compiling FoundationModelsKit GeminiLanguageModel.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:92:81: error: cannot find type 'URLRequest' in scope
 90 |     }
 91 |
 92 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 93 |         let method = stream ? "streamGenerateContent" : "generateContent"
 94 |         var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 |     }
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:106:26: error: cannot find 'URLRequest' in scope
104 |         }
105 |
106 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
107 |         urlRequest.httpMethod = "POST"
108 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/GeminiLanguageModel.swift:118:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
119 |             if Self.isTransient(statusCode: http.statusCode) {
120 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:119:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 |                 throw LanguageModelError.unavailable
121 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:123:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 |             }
122 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
123 |             throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
124 |         }
125 |     }
[3/16] Compiling FoundationModelsKit LanguageModelProviding.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:92:81: error: cannot find type 'URLRequest' in scope
 90 |     }
 91 |
 92 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 93 |         let method = stream ? "streamGenerateContent" : "generateContent"
 94 |         var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 |     }
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:106:26: error: cannot find 'URLRequest' in scope
104 |         }
105 |
106 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
107 |         urlRequest.httpMethod = "POST"
108 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:117:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/GeminiLanguageModel.swift:118:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
116 |     private func validate(response: URLResponse, data: Data?) throws {
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
119 |             if Self.isTransient(statusCode: http.statusCode) {
120 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:119:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
119 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
120 |                 throw LanguageModelError.unavailable
121 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:123:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
121 |             }
122 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
123 |             throw GeminiError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
124 |         }
125 |     }
[4/18] Compiling FoundationModelsKit MockLanguageModel.swift
[5/18] Compiling FoundationModelsKit ModelRouter.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[6/18] Emitting module FoundationModelsKit
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 71 |     private let tools: ToolRegistry
 72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                  `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 81 |     ) {
 82 |         self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                                `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 81 |     ) {
 82 |         self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:166:81: error: cannot find type 'URLRequest' in scope
164 |     // MARK: - Private helpers
165 |
166 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
167 |         try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 |     }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 |     }
169 |
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 |     }
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 71 |     private let tools: ToolRegistry
 72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/GeminiLanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/GeminiLanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:92:81: error: cannot find type 'URLRequest' in scope
 90 |     }
 91 |
 92 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 93 |         let method = stream ? "streamGenerateContent" : "generateContent"
 94 |         var components = URLComponents(
/host/spi-builder-workspace/Sources/FoundationModelsKit/GeminiLanguageModel.swift:116:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
114 |     }
115 |
116 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
117 |         guard let http = response as? HTTPURLResponse else { return }
118 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/GeminiLanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: GeminiConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'GeminiLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: GeminiConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
 91 |     }
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
 95 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 |     }
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         self.config = config
 93 |         self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                                        `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         self.config = config
 93 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
[7/18] Compiling FoundationModelsKit AnthropicLanguageModel.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 71 |     private let tools: ToolRegistry
 72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                  `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 81 |     ) {
 82 |         self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                                `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 81 |     ) {
 82 |         self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:166:81: error: cannot find type 'URLRequest' in scope
164 |     // MARK: - Private helpers
165 |
166 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
167 |         try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 |     }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 |     }
169 |
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 |     }
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 71 |     private let tools: ToolRegistry
 72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:95:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 93 |         for _ in 0..<Self.maxToolTurns {
 94 |             let urlRequest = try makeRequest(messages: messages, stream: false)
 95 |             let (data, response) = try await session.data(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 96 |             try validate(response: response, data: data)
 97 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:172:26: error: cannot find 'URLRequest' in scope
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
173 |         urlRequest.httpMethod = "POST"
174 |         urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/AnthropicLanguageModel.swift:214:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
215 |             if Self.isTransient(statusCode: http.statusCode) {
216 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:215:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 |                 throw LanguageModelError.unavailable
217 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:220:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
218 |             // Client error: retrying would resend the same bad request.
219 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
220 |             throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
    |                                                            `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
221 |         }
222 |     }
[8/18] Compiling FoundationModelsKit ConversationStore.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:70:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 71 |     private let tools: ToolRegistry
 72 |
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:18: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                  `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 81 |     ) {
 82 |         self.config = config
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/FoundationModelsKit/AnthropicLanguageModel.swift:80:32: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 78 |         config: AnthropicConfiguration,
 79 |         tools: [any ModelTool] = [],
 80 |         session: URLSession = .shared
    |                                `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 81 |     ) {
 82 |         self.config = config
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:166:81: error: cannot find type 'URLRequest' in scope
164 |     // MARK: - Private helpers
165 |
166 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
167 |         try makeRequest(messages: [["role": "user", "content": request.content]], stream: stream)
168 |     }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:170:81: error: cannot find type 'URLRequest' in scope
168 |     }
169 |
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:212:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
210 |     }
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/AnthropicLanguageModel.swift:70:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 68 |
 69 |     private let config: AnthropicConfiguration
 70 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicLanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 71 |     private let tools: ToolRegistry
 72 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:95:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 93 |         for _ in 0..<Self.maxToolTurns {
 94 |             let urlRequest = try makeRequest(messages: messages, stream: false)
 95 |             let (data, response) = try await session.data(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 96 |             try validate(response: response, data: data)
 97 |
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:172:26: error: cannot find 'URLRequest' in scope
170 |     private func makeRequest(messages: [[String: Any]], stream: Bool) throws -> URLRequest {
171 |         let url = config.baseURL.appendingPathComponent("v1/messages")
172 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
173 |         urlRequest.httpMethod = "POST"
174 |         urlRequest.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:213:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
211 |
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/AnthropicLanguageModel.swift:214:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
212 |     private func validate(response: URLResponse, data: Data?) throws {
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
215 |             if Self.isTransient(statusCode: http.statusCode) {
216 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:215:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
213 |         guard let http = response as? HTTPURLResponse else { return }
214 |         guard (200..<300).contains(http.statusCode) else {
215 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
216 |                 throw LanguageModelError.unavailable
217 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/AnthropicLanguageModel.swift:220:60: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
218 |             // Client error: retrying would resend the same bad request.
219 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
220 |             throw AnthropicError.apiError(statusCode: http.statusCode, body: detail)
    |                                                            `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
221 |         }
222 |     }
[9/18] Compiling FoundationModelsKit DynamicProfileBuilder.swift
[10/18] Compiling FoundationModelsKit EvaluationSuite.swift
[11/18] Compiling FoundationModelsKit OpenAILanguageModel.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
 91 |     }
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
 95 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 |     }
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:94:26: error: cannot find 'URLRequest' in scope
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
    |                          `- error: cannot find 'URLRequest' in scope
 95 |         urlRequest.httpMethod = "POST"
 96 |         urlRequest.setValue("Bearer \(config.apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/OpenAILanguageModel.swift:112:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
113 |             if Self.isTransient(statusCode: http.statusCode) {
114 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:113:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
114 |                 throw LanguageModelError.unavailable
115 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:117:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
115 |             }
116 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
117 |             throw OpenAIError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 |         }
119 |     }
[12/18] Compiling FoundationModelsKit RegionalAvailability.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:44:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/OpenAILanguageModel.swift:46:55: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                       `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |         self.config = config
 48 |         self.session = session
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/FoundationModelsKit/OpenAILanguageModel.swift:46:69: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |     private let session: URLSession
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
    |                                                                     `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |         self.config = config
 48 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:93:81: error: cannot find type 'URLRequest' in scope
 91 |     }
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
    |                                                                                 `- error: cannot find type 'URLRequest' in scope
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
 95 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:110:37: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
108 |     }
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
    |                                     `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
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/FoundationModelsKit/OpenAILanguageModel.swift:44:17: error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 42 |
 43 |     private let config: OpenAIConfiguration
 44 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'OpenAILanguageModel' has non-sendable type 'URLSession' (aka 'AnyObject')
 45 |
 46 |     public init(config: OpenAIConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:53:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 51 |     public func respond(to request: ModelRequest) async throws -> ModelResponse {
 52 |         let urlRequest = try makeRequest(for: request, stream: false)
 53 |         let (data, response) = try await session.data(for: urlRequest)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 54 |         try validate(response: response, data: data)
 55 |         return try decode(data: data)
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:94:26: error: cannot find 'URLRequest' in scope
 92 |
 93 |     private func makeRequest(for request: ModelRequest, stream: Bool) throws -> URLRequest {
 94 |         var urlRequest = URLRequest(url: config.baseURL.appendingPathComponent("v1/chat/completions"))
    |                          `- error: cannot find 'URLRequest' in scope
 95 |         urlRequest.httpMethod = "POST"
 96 |         urlRequest.setValue("Bearer \(config.apiKey)", forHTTPHeaderField: "Authorization")
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:35: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                   `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:111:39: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
109 |
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
    |                                       `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
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/FoundationModelsKit/OpenAILanguageModel.swift:112:41: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
110 |     private func validate(response: URLResponse, data: Data?) throws {
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
    |                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
113 |             if Self.isTransient(statusCode: http.statusCode) {
114 |                 throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:113:50: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
111 |         guard let http = response as? HTTPURLResponse else { return }
112 |         guard (200..<300).contains(http.statusCode) else {
113 |             if Self.isTransient(statusCode: http.statusCode) {
    |                                                  `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
114 |                 throw LanguageModelError.unavailable
115 |             }
/host/spi-builder-workspace/Sources/FoundationModelsKit/OpenAILanguageModel.swift:117:57: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
115 |             }
116 |             let detail = data.flatMap { String(data: $0, encoding: .utf8) } ?? ""
117 |             throw OpenAIError.apiError(statusCode: http.statusCode, body: detail)
    |                                                         `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
118 |         }
119 |     }
[13/18] Compiling FoundationModelsKit OnDeviceLanguageModel.swift
[14/18] Compiling FoundationModelsKit OnDeviceToolBridge.swift
[15/18] Compiling FoundationModelsKit RetryPolicy.swift
[16/18] Compiling FoundationModelsKit SDKIntegration.swift
[17/18] Compiling FoundationModelsKit TokenEstimator.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         self.config = config
 93 |         self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                                        `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         self.config = config
 93 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:97:23: error: cannot find 'URLRequest' in scope
 95 |
 96 |     public func exactTokenCount(of text: String) async throws -> Int {
 97 |         var request = URLRequest(url: config.baseURL.appendingPathComponent("v1/messages/count_tokens"))
    |                       `- error: cannot find 'URLRequest' in scope
 98 |         request.httpMethod = "POST"
 99 |         request.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:107:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
105 |         ])
106 |
107 |         let (data, response) = try await session.data(for: request)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
108 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
109 |             throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:20: error: cannot find 'CFGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                    `- error: cannot find 'CFGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:38: error: cannot find 'CFBooleanGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                                      `- error: cannot find 'CFBooleanGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
[18/18] Compiling FoundationModelsKit Tool.swift
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:26: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
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/FoundationModelsKit/TokenEstimator.swift:91:58: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                          `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 92 |         self.config = config
 93 |         self.session = session
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/FoundationModelsKit/TokenEstimator.swift:91:72: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 89 |     private let session: URLSession
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
    |                                                                        `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 92 |         self.config = config
 93 |         self.session = session
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:89:17: error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 87 | public struct AnthropicTokenCounter: Sendable {
 88 |     private let config: AnthropicConfiguration
 89 |     private let session: URLSession
    |                 `- error: stored property 'session' of 'Sendable'-conforming struct 'AnthropicTokenCounter' has non-sendable type 'URLSession' (aka 'AnyObject')
 90 |
 91 |     public init(config: AnthropicConfiguration, session: URLSession = .shared) {
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:97:23: error: cannot find 'URLRequest' in scope
 95 |
 96 |     public func exactTokenCount(of text: String) async throws -> Int {
 97 |         var request = URLRequest(url: config.baseURL.appendingPathComponent("v1/messages/count_tokens"))
    |                       `- error: cannot find 'URLRequest' in scope
 98 |         request.httpMethod = "POST"
 99 |         request.setValue(config.apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/FoundationModelsKit/TokenEstimator.swift:107:50: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
105 |         ])
106 |
107 |         let (data, response) = try await session.data(for: request)
    |                                                  `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
108 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
109 |             throw LanguageModelError.unavailable
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:20: error: cannot find 'CFGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                    `- error: cannot find 'CFGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
/host/spi-builder-workspace/Sources/FoundationModelsKit/Tool.swift:67:38: error: cannot find 'CFBooleanGetTypeID' in scope
 65 |         // Must precede any Bool case: NSNumber(1) bridges to Bool as true.
 66 |         case let v as NSNumber:
 67 |             self = CFGetTypeID(v) == CFBooleanGetTypeID() ? .bool(v.boolValue) : .number(v.doubleValue)
    |                                      `- error: cannot find 'CFBooleanGetTypeID' in scope
 68 |         case let v as String:
 69 |             self = .string(v)
BUILD FAILURE 6.1 android