The Swift Package Index logo.Swift Package Index

Build Information

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

Build Command

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

Build Log

1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
23 |     ) {
24 |         self.resourceName = resourceName
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:35: error: value of type '_' expected to be instance of class or class-constrained type
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
23 |     ) {
24 |         self.resourceName = resourceName
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:13:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AzureOpenAIProvider' has non-Sendable type 'AnyObject'
11 |     public var useDeploymentBasedUrls: Bool
12 |     public var headers: [String: String]
13 |     private let urlSession: URLSession
   |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AzureOpenAIProvider' has non-Sendable type 'AnyObject'
14 |
15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:35: error: value of type '_' expected to be instance of class or class-constrained type
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:54: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                      `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:68: error: value of type '_' expected to be instance of class or class-constrained type
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                                    `- error: value of type '_' expected to be instance of class or class-constrained type
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:68: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                                    `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:11:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  9 |     public var baseURL: URL?
 10 |     public var headers: [String: String]
 11 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 |
 13 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     ) {
 20 |         self.region = region
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 19 |     ) {
 20 |         self.region = region
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:35: error: value of type '_' expected to be instance of class or class-constrained type
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 19 |     ) {
 20 |         self.region = region
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:11:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockMantleProvider' has non-Sendable type 'AnyObject'
  9 |     public var baseURL: URL?
 10 |     public var headers: [String: String]
 11 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockMantleProvider' has non-Sendable type 'AnyObject'
 12 |
 13 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:20:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     private let baseURL: URL
 19 |     private let headers: [String: String]
 20 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |
 22 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 32 |     ) {
 33 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:35: error: value of type '_' expected to be instance of class or class-constrained type
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:76:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
 74 |
 75 |     private static func pumpEvents(
 76 |         from bytes: URLSession.AsyncBytes,
    |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
 77 |         isForcedJSON: Bool,
 78 |         into continuation: AsyncThrowingStream<StreamPart, Error>.Continuation
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:191:69: error: cannot find type 'URLRequest' in scope
189 |     static let jsonToolName = "json"
190 |
191 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
192 |         guard let url = URL(
193 |             string: "\(baseURL.absoluteString)/model/\(Self.encodeModelID(modelID))/converse-stream"
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:215:40: error: cannot find type 'URLRequest' in scope
213 |     }
214 |
215 |     func signSigV4(_ urlRequest: inout URLRequest, url: URL, body: Data) throws {
    |                                        `- error: cannot find type 'URLRequest' in scope
216 |         #if canImport(CryptoKit)
217 |         guard let host = url.host else {
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:20:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockModel' has non-Sendable type 'AnyObject'
 18 |     private let baseURL: URL
 19 |     private let headers: [String: String]
 20 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockModel' has non-Sendable type 'AnyObject'
 21 |
 22 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:54:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 52 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 53 |         let urlRequest = try buildURLRequest(request)
 54 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 55 |
 56 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
/host/spi-builder-workspace/Sources/AI/Streaming/AWSEventStream.swift:149:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
147 | enum AWSEventStream {
148 |     static func messages(
149 |         from bytes: URLSession.AsyncBytes
    |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
150 |     ) -> AsyncThrowingStream<AWSEventStreamMessage, Error> {
151 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:198:26: error: cannot find 'URLRequest' in scope
196 |         }
197 |
198 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
199 |         urlRequest.httpMethod = "POST"
200 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
[127/136] Compiling AI BedrockMantleProvider.swift
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:118:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
116 |     private let headers: [String: String]
117 |     private let auth: MCPOAuthSession?
118 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 |     private var sessionID: String?
120 |
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:125:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
123 |         headers: [String: String] = [:],
124 |         auth: MCPOAuthSession? = nil,
125 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
126 |     ) {
127 |         self.url = url
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:125:35: error: value of type '_' expected to be instance of class or class-constrained type
123 |         headers: [String: String] = [:],
124 |         auth: MCPOAuthSession? = nil,
125 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
126 |     ) {
127 |         self.url = url
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:125:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
123 |         headers: [String: String] = [:],
124 |         auth: MCPOAuthSession? = nil,
125 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
126 |     ) {
127 |         self.url = url
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:183:63: error: cannot find type 'URLRequest' in scope
181 |     }
182 |
183 |     private func makeRequest(body: JSONValue) async throws -> URLRequest {
    |                                                               `- error: cannot find type 'URLRequest' in scope
184 |         var urlRequest = URLRequest(url: url)
185 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:140:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
138 |             "params": params
139 |         ])
140 |         var (data, response) = try await urlSession.data(for: try await makeRequest(body: body))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
141 |         guard var http = response as? HTTPURLResponse else {
142 |             throw AIError.transport("MCP transport got a non-HTTP response")
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:153:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
151 |                 )
152 |             }
153 |             (data, response) = try await urlSession.data(for: try await makeRequest(body: body))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
154 |             guard let retried = response as? HTTPURLResponse else {
155 |                 throw AIError.transport("MCP transport got a non-HTTP response")
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:180:35: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
178 |         ])
179 |         guard let request = try? await makeRequest(body: body) else { return }
180 |         _ = try? await urlSession.data(for: request)
    |                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
181 |     }
182 |
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:184:26: error: cannot find 'URLRequest' in scope
182 |
183 |     private func makeRequest(body: JSONValue) async throws -> URLRequest {
184 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
185 |         urlRequest.httpMethod = "POST"
186 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:150:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
148 |         for serverURL: URL,
149 |         wwwAuthenticate: String? = nil,
150 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
151 |     ) async throws -> (
152 |         authorizationServer: MCPAuthorizationServerMetadata,
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:150:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
148 |         for serverURL: URL,
149 |         wwwAuthenticate: String? = nil,
150 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
151 |     ) async throws -> (
152 |         authorizationServer: MCPAuthorizationServerMetadata,
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:150:35: error: value of type '_' expected to be instance of class or class-constrained type
148 |         for serverURL: URL,
149 |         wwwAuthenticate: String? = nil,
150 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
151 |     ) async throws -> (
152 |         authorizationServer: MCPAuthorizationServerMetadata,
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:175:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
173 |         for serverURL: URL,
174 |         wwwAuthenticate: String? = nil,
175 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
176 |     ) async throws -> MCPProtectedResourceMetadata {
177 |         var candidates: [URL] = []
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:175:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
173 |         for serverURL: URL,
174 |         wwwAuthenticate: String? = nil,
175 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
176 |     ) async throws -> MCPProtectedResourceMetadata {
177 |         var candidates: [URL] = []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:175:35: error: value of type '_' expected to be instance of class or class-constrained type
173 |         for serverURL: URL,
174 |         wwwAuthenticate: String? = nil,
175 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
176 |     ) async throws -> MCPProtectedResourceMetadata {
177 |         var candidates: [URL] = []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:311:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
309 |     public static func discoverAuthorizationServerMetadata(
310 |         issuer: URL,
311 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
312 |     ) async throws -> MCPAuthorizationServerMetadata {
313 |         guard isSecureEndpoint(issuer) else {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:311:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
309 |     public static func discoverAuthorizationServerMetadata(
310 |         issuer: URL,
311 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
312 |     ) async throws -> MCPAuthorizationServerMetadata {
313 |         guard isSecureEndpoint(issuer) else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:311:35: error: value of type '_' expected to be instance of class or class-constrained type
309 |     public static func discoverAuthorizationServerMetadata(
310 |         issuer: URL,
311 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
312 |     ) async throws -> MCPAuthorizationServerMetadata {
313 |         guard isSecureEndpoint(issuer) else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:337:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
335 |     public static func discoverAuthorizationServerMetadata(
336 |         for serverURL: URL,
337 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
338 |     ) async throws -> MCPAuthorizationServerMetadata {
339 |         try await discoverAuthorizationServerMetadata(issuer: serverURL, urlSession: urlSession)
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:337:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
335 |     public static func discoverAuthorizationServerMetadata(
336 |         for serverURL: URL,
337 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
338 |     ) async throws -> MCPAuthorizationServerMetadata {
339 |         try await discoverAuthorizationServerMetadata(issuer: serverURL, urlSession: urlSession)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:337:35: error: value of type '_' expected to be instance of class or class-constrained type
335 |     public static func discoverAuthorizationServerMetadata(
336 |         for serverURL: URL,
337 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
338 |     ) async throws -> MCPAuthorizationServerMetadata {
339 |         try await discoverAuthorizationServerMetadata(issuer: serverURL, urlSession: urlSession)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:342:60: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
340 |     }
341 |
342 |     private static func fetchJSON(at url: URL, urlSession: URLSession) async throws -> Data {
    |                                                            `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
343 |         var request = URLRequest(url: url)
344 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:353:54: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
351 |
352 |     private static func fetchAuthorizationServerMetadata(
353 |         at url: URL, issuer: URL? = nil, urlSession: URLSession
    |                                                      `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
354 |     ) async throws -> MCPAuthorizationServerMetadata {
355 |         var request = URLRequest(url: url)
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:408:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
406 |         metadata: MCPAuthorizationServerMetadata,
407 |         provider: any MCPOAuthClientProvider,
408 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
409 |     ) async throws -> MCPOAuthClientInformation {
410 |         if let existing = await provider.clientInformation() { return existing }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:408:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
406 |         metadata: MCPAuthorizationServerMetadata,
407 |         provider: any MCPOAuthClientProvider,
408 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
409 |     ) async throws -> MCPOAuthClientInformation {
410 |         if let existing = await provider.clientInformation() { return existing }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:408:35: error: value of type '_' expected to be instance of class or class-constrained type
406 |         metadata: MCPAuthorizationServerMetadata,
407 |         provider: any MCPOAuthClientProvider,
408 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
409 |     ) async throws -> MCPOAuthClientInformation {
410 |         if let existing = await provider.clientInformation() { return existing }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:519:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
517 |         provider: any MCPOAuthClientProvider,
518 |         resource: URL? = nil,
519 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
520 |     ) async throws -> MCPOAuthTokens {
521 |         guard let verifier = await provider.codeVerifier() else {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:519:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
517 |         provider: any MCPOAuthClientProvider,
518 |         resource: URL? = nil,
519 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
520 |     ) async throws -> MCPOAuthTokens {
521 |         guard let verifier = await provider.codeVerifier() else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:519:35: error: value of type '_' expected to be instance of class or class-constrained type
517 |         provider: any MCPOAuthClientProvider,
518 |         resource: URL? = nil,
519 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
520 |     ) async throws -> MCPOAuthTokens {
521 |         guard let verifier = await provider.codeVerifier() else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:546:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
544 |         provider: any MCPOAuthClientProvider,
545 |         resource: URL? = nil,
546 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
547 |     ) async throws -> MCPOAuthTokens {
548 |         let query = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)?.queryItems ?? []
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:546:35: error: value of type '_' expected to be instance of class or class-constrained type
544 |         provider: any MCPOAuthClientProvider,
545 |         resource: URL? = nil,
546 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
547 |     ) async throws -> MCPOAuthTokens {
548 |         let query = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)?.queryItems ?? []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:546:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
544 |         provider: any MCPOAuthClientProvider,
545 |         resource: URL? = nil,
546 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
547 |     ) async throws -> MCPOAuthTokens {
548 |         let query = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)?.queryItems ?? []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:580:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
578 |         provider: any MCPOAuthClientProvider,
579 |         resource: URL? = nil,
580 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
581 |     ) async throws -> MCPOAuthTokens {
582 |         guard let refreshToken = tokens.refreshToken else {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:580:35: error: value of type '_' expected to be instance of class or class-constrained type
578 |         provider: any MCPOAuthClientProvider,
579 |         resource: URL? = nil,
580 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
581 |     ) async throws -> MCPOAuthTokens {
582 |         guard let refreshToken = tokens.refreshToken else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:580:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
578 |         provider: any MCPOAuthClientProvider,
579 |         resource: URL? = nil,
580 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
581 |     ) async throws -> MCPOAuthTokens {
582 |         guard let refreshToken = tokens.refreshToken else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:623:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
621 |         for serverURL: URL,
622 |         provider: any MCPOAuthClientProvider,
623 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
624 |     ) async throws -> MCPOAuthTokens? {
625 |         guard let tokens = await provider.tokens() else { return nil }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:623:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
621 |         for serverURL: URL,
622 |         provider: any MCPOAuthClientProvider,
623 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
624 |     ) async throws -> MCPOAuthTokens? {
625 |         guard let tokens = await provider.tokens() else { return nil }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:623:35: error: value of type '_' expected to be instance of class or class-constrained type
621 |         for serverURL: URL,
622 |         provider: any MCPOAuthClientProvider,
623 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
624 |     ) async throws -> MCPOAuthTokens? {
625 |         guard let tokens = await provider.tokens() else { return nil }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:648:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
646 |         clientInformation: MCPOAuthClientInformation,
647 |         params: [String: String],
648 |         urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
649 |     ) async throws -> MCPOAuthTokens {
650 |         var body = params
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:749:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
747 |     public let serverURL: URL
748 |     private let provider: any MCPOAuthClientProvider
749 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
750 |
751 |     private var authorizationServer: MCPAuthorizationServerMetadata?
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:757:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
755 |         serverURL: URL,
756 |         provider: any MCPOAuthClientProvider,
757 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
758 |     ) {
759 |         self.serverURL = serverURL
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:757:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
755 |         serverURL: URL,
756 |         provider: any MCPOAuthClientProvider,
757 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
758 |     ) {
759 |         self.serverURL = serverURL
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:757:35: error: value of type '_' expected to be instance of class or class-constrained type
755 |         serverURL: URL,
756 |         provider: any MCPOAuthClientProvider,
757 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
758 |     ) {
759 |         self.serverURL = serverURL
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:343:23: error: cannot find 'URLRequest' in scope
341 |
342 |     private static func fetchJSON(at url: URL, urlSession: URLSession) async throws -> Data {
343 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
344 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
345 |         let (data, response) = try await urlSession.data(for: request)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:345:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
343 |         var request = URLRequest(url: url)
344 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
345 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
346 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
347 |             throw AIError.transport("No metadata at \(url.absoluteString)")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:355:23: error: cannot find 'URLRequest' in scope
353 |         at url: URL, issuer: URL? = nil, urlSession: URLSession
354 |     ) async throws -> MCPAuthorizationServerMetadata {
355 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
356 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
357 |         let (data, response) = try await urlSession.data(for: request)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:357:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
355 |         var request = URLRequest(url: url)
356 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
357 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
358 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
359 |             throw AIError.transport("No OAuth metadata at \(url.absoluteString)")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:417:23: error: cannot find 'URLRequest' in scope
415 |             )
416 |         }
417 |         var request = URLRequest(url: registrationEndpoint)
    |                       `- error: cannot find 'URLRequest' in scope
418 |         request.httpMethod = "POST"
419 |         request.setValue("application/json", forHTTPHeaderField: "Content-Type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:421:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
419 |         request.setValue("application/json", forHTTPHeaderField: "Content-Type")
420 |         request.httpBody = try JSONEncoder().encode(Self.registrationRequestBody(provider.clientMetadata))
421 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
422 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
423 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:423:72: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
421 |         let (data, response) = try await urlSession.data(for: request)
422 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
423 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
    |                                                                        `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
424 |         }
425 |         let info = try Self.parseClientRegistration(data)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:655:23: error: cannot find 'URLRequest' in scope
653 |             body["client_secret"] = secret
654 |         }
655 |         var request = URLRequest(url: metadata.tokenEndpoint)
    |                       `- error: cannot find 'URLRequest' in scope
656 |         request.httpMethod = "POST"
657 |         request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:660:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
658 |         request.httpBody = Self.encodeFormBody(body)
659 |
660 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
661 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
662 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:662:72: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
660 |         let (data, response) = try await urlSession.data(for: request)
661 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
662 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
    |                                                                        `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
663 |         }
664 |         // Stamp the issuer so a later refresh can verify it hasn't been pointed
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:9:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  7 |     private let sseURL: URL
  8 |     private let headers: [String: String]
  9 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 10 |     private let requestTimeout: TimeInterval
 11 |
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:26:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 24 |         headers: [String: String] = [:],
 25 |         auth: MCPOAuthSession? = nil,
 26 |         urlSession: URLSession = .shared,
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 27 |         requestTimeout: TimeInterval = 60
 28 |     ) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:26:35: error: value of type '_' expected to be instance of class or class-constrained type
 24 |         headers: [String: String] = [:],
 25 |         auth: MCPOAuthSession? = nil,
 26 |         urlSession: URLSession = .shared,
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 27 |         requestTimeout: TimeInterval = 60
 28 |     ) {
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:26:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 24 |         headers: [String: String] = [:],
 25 |         auth: MCPOAuthSession? = nil,
 26 |         urlSession: URLSession = .shared,
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 27 |         requestTimeout: TimeInterval = 60
 28 |     ) {
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:89:27: error: cannot find 'URLRequest' in scope
 87 |     private func readLoop() async {
 88 |         do {
 89 |             var request = URLRequest(url: sseURL)
    |                           `- error: cannot find 'URLRequest' in scope
 90 |             request.setValue("text/event-stream", forHTTPHeaderField: "Accept")
 91 |             for (field, value) in headers { request.setValue(value, forHTTPHeaderField: field) }
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:95:58: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 93 |                 request.setValue(header, forHTTPHeaderField: "Authorization")
 94 |             }
 95 |             let (bytes, response) = try await urlSession.bytes(for: request)
    |                                                          `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 96 |             if let http = response as? HTTPURLResponse, http.statusCode == 401, let auth {
 97 |                 let challenge = http.value(forHTTPHeaderField: "WWW-Authenticate")
/host/spi-builder-workspace/Sources/AI/Streaming/SSE.swift:45:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
43 | enum SSE {
44 |     static func events(
45 |         from bytes: URLSession.AsyncBytes
   |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
46 |     ) -> AsyncThrowingStream<SSEEvent, Error> {
47 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:156:23: error: cannot find 'URLRequest' in scope
154 |
155 |     private func post(body: JSONValue, to endpoint: URL) async throws {
156 |         var request = URLRequest(url: endpoint)
    |                       `- error: cannot find 'URLRequest' in scope
157 |         request.httpMethod = "POST"
158 |         request.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:164:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
162 |         }
163 |         request.httpBody = try JSONEncoder().encode(body)
164 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
165 |         guard let http = response as? HTTPURLResponse else {
166 |             throw AIError.transport("MCP SSE post got a non-HTTP response")
/host/spi-builder-workspace/Sources/AI/Providers/AIGatewayModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = aiGatewayConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AIGatewayModel.swift:19:35: error: value of type '_' expected to be instance of class or class-constrained type
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
20 |     ) {
21 |         engine = aiGatewayConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AIGatewayModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = aiGatewayConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
 18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
 19 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |     ) {
 21 |         engine = alibabaConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
 18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
 19 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 20 |     ) {
 21 |         engine = alibabaConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:19:35: error: value of type '_' expected to be instance of class or class-constrained type
 17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
 18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
 19 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 20 |     ) {
 21 |         engine = alibabaConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:36:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 34 |     private let dimension: Int?
 35 |     private let headers: [String: String]
 36 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 37 |
 38 |     static let maxTextsPerCall = 10
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:46:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |         dimension: Int? = nil,
 45 |         headers: [String: String] = [:],
 46 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |     ) {
 48 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:46:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |         dimension: Int? = nil,
 45 |         headers: [String: String] = [:],
 46 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |     ) {
 48 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:46:35: error: value of type '_' expected to be instance of class or class-constrained type
 44 |         dimension: Int? = nil,
 45 |         headers: [String: String] = [:],
 46 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 47 |     ) {
 48 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:75:55: error: cannot find type 'URLRequest' in scope
 73 |     }
 74 |
 75 |     func buildURLRequest(_ texts: [String]) throws -> URLRequest {
    |                                                       `- error: cannot find type 'URLRequest' in scope
 76 |         var parameters: [String: JSONValue] = [:]
 77 |         if let dimension { parameters["dimension"] = .number(Double(dimension)) }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:36:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaEmbeddingModel' has non-Sendable type 'AnyObject'
 34 |     private let dimension: Int?
 35 |     private let headers: [String: String]
 36 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaEmbeddingModel' has non-Sendable type 'AnyObject'
 37 |
 38 |     static let maxTextsPerCall = 10
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:103:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
101 |     private let baseURL: URL
102 |     private let headers: [String: String]
103 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
104 |     private let pollInterval: TimeInterval
105 |     private let pollTimeout: TimeInterval
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:114:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 |         pollInterval: TimeInterval = 5,
113 |         pollTimeout: TimeInterval = 600,
114 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |     ) {
116 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:114:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
112 |         pollInterval: TimeInterval = 5,
113 |         pollTimeout: TimeInterval = 600,
114 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
115 |     ) {
116 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:114:35: error: value of type '_' expected to be instance of class or class-constrained type
112 |         pollInterval: TimeInterval = 5,
113 |         pollTimeout: TimeInterval = 600,
114 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
115 |     ) {
116 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:160:69: error: cannot find type 'URLRequest' in scope
158 |     }
159 |
160 |     func buildCreateRequest(_ request: VideoModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
161 |         var input: [String: JSONValue] = ["prompt": .string(request.prompt)]
162 |         if let image = request.image {
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:103:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaVideoModel' has non-Sendable type 'AnyObject'
101 |     private let baseURL: URL
102 |     private let headers: [String: String]
103 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaVideoModel' has non-Sendable type 'AnyObject'
104 |     private let pollInterval: TimeInterval
105 |     private let pollTimeout: TimeInterval
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:61:57: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 59 |         for start in stride(from: 0, to: texts.count, by: Self.maxTextsPerCall) {
 60 |             let batch = Array(texts[start..<min(start + Self.maxTextsPerCall, texts.count)])
 61 |             let (data, response) = try await urlSession.data(for: try buildURLRequest(batch))
    |                                                         `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 62 |             if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 63 |                 throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:66:26: error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
 64 |             }
 65 |             let decoded = try JSONDecoder().decode(JSONValue.self, from: data)
 66 |             let sorted = (decoded["output"]?["embeddings"]?.arrayValue ?? []).sorted {
    |                          `- error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
 67 |                 ($0["text_index"]?.intValue ?? 0) < ($1["text_index"]?.intValue ?? 0)
 68 |             }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:69:76: error: value of type '[Any]??' has no member 'compactMap'
 67 |                 ($0["text_index"]?.intValue ?? 0) < ($1["text_index"]?.intValue ?? 0)
 68 |             }
 69 |             embeddings += sorted.map { ($0["embedding"]?.arrayValue ?? []).compactMap(\.doubleValue) }
    |                                                                            `- error: value of type '[Any]??' has no member 'compactMap'
 70 |             usage = usage + Usage(inputTokens: decoded["usage"]?["total_tokens"]?.intValue ?? 0)
 71 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:69:87: error: cannot infer key path type from context; consider explicitly specifying a root type
 67 |                 ($0["text_index"]?.intValue ?? 0) < ($1["text_index"]?.intValue ?? 0)
 68 |             }
 69 |             embeddings += sorted.map { ($0["embedding"]?.arrayValue ?? []).compactMap(\.doubleValue) }
    |                                                                                       `- error: cannot infer key path type from context; consider explicitly specifying a root type
 70 |             usage = usage + Usage(inputTokens: decoded["usage"]?["total_tokens"]?.intValue ?? 0)
 71 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:84:26: error: cannot find 'URLRequest' in scope
 82 |         ])
 83 |
 84 |         var urlRequest = URLRequest(
    |                          `- error: cannot find 'URLRequest' in scope
 85 |             url: baseURL.appendingPathComponent("services/embeddings/text-embedding/text-embedding")
 86 |         )
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:126:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
124 |
125 |     public func generateVideos(_ request: VideoModelRequest) async throws -> VideoModelResponse {
126 |         let (createData, createResponse) = try await urlSession.data(for: try buildCreateRequest(request))
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
127 |         if let http = createResponse as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
128 |             throw AIError.http(status: http.statusCode, body: String(decoding: createData, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:139:24: error: cannot find 'URLRequest' in scope
137 |             try await Task.sleep(nanoseconds: pollNanoseconds(pollInterval))
138 |             if Date() > deadline { throw AIError.transport("Alibaba video generation timed out") }
139 |             var poll = URLRequest(url: baseURL.appendingPathComponent("api/v1/tasks/\(taskID)"))
    |                        `- error: cannot find 'URLRequest' in scope
140 |             poll.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
141 |             for (field, value) in headers { poll.setValue(value, forHTTPHeaderField: field) }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:142:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
140 |             poll.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
141 |             for (field, value) in headers { poll.setValue(value, forHTTPHeaderField: field) }
142 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
143 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
144 |             switch status["output"]?["task_status"]?.stringValue {
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:176:26: error: cannot find 'URLRequest' in scope
174 |         }
175 |
176 |         var urlRequest = URLRequest(
    |                          `- error: cannot find 'URLRequest' in scope
177 |             url: baseURL.appendingPathComponent("api/v1/services/aigc/video-generation/video-synthesis")
178 |         )
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:14:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 |     let anthropicVersion: String
 13 |     let headers: [String: String]
 14 |     let urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |
 16 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:22:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |         anthropicVersion: String = "2023-06-01",
 21 |         headers: [String: String] = [:],
 22 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 23 |     ) {
 24 |         self.init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:22:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 20 |         anthropicVersion: String = "2023-06-01",
 21 |         headers: [String: String] = [:],
 22 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 23 |     ) {
 24 |         self.init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:22:35: error: value of type '_' expected to be instance of class or class-constrained type
 20 |         anthropicVersion: String = "2023-06-01",
 21 |         headers: [String: String] = [:],
 22 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 23 |     ) {
 24 |         self.init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:41:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 39 |         anthropicVersion: String,
 40 |         headers: [String: String],
 41 |         urlSession: URLSession,
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |         providerName: String
 43 |     ) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:156:69: error: cannot find type 'URLRequest' in scope
154 |     }
155 |
156 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
157 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent("messages"))
158 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:14:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicModel' has non-Sendable type 'AnyObject'
 12 |     let anthropicVersion: String
 13 |     let headers: [String: String]
 14 |     let urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicModel' has non-Sendable type 'AnyObject'
 15 |
 16 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:57:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 55 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 56 |         let urlRequest = try buildURLRequest(request)
 57 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 58 |
 59 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:157:26: error: cannot find 'URLRequest' in scope
155 |
156 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
157 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent("messages"))
    |                          `- error: cannot find 'URLRequest' in scope
158 |         urlRequest.httpMethod = "POST"
159 |         urlRequest.setValue(apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:11:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  9 |     var anthropicVersion: String
 10 |     var headers: [String: String]
 11 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 |
 13 |     init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:18:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 16 |         anthropicVersion: String,
 17 |         headers: [String: String],
 18 |         urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     ) {
 20 |         self.apiKey = apiKey ?? ProcessInfo.processInfo.environment["ANTHROPIC_API_KEY"] ?? ""
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:29:10: error: cannot find type 'URLRequest' in scope
 27 |     func request(
 28 |         _ method: String, _ path: String, query: [String: String] = [:], beta: [String] = []
 29 |     ) -> URLRequest {
    |          `- error: cannot find type 'URLRequest' in scope
 30 |         let base = baseURL.appendingPathComponent(path)
 31 |         var url = base
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:86:35: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 84 |     }
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
    |                                   `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
  |                  `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:11:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicHTTP' has non-Sendable type 'AnyObject'
  9 |     var anthropicVersion: String
 10 |     var headers: [String: String]
 11 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicHTTP' has non-Sendable type 'AnyObject'
 12 |
 13 |     init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:135:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
133 |         anthropicVersion: String = "2023-06-01",
134 |         headers: [String: String] = [:],
135 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
136 |     ) {
137 |         self.http = AnthropicHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:135:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
133 |         anthropicVersion: String = "2023-06-01",
134 |         headers: [String: String] = [:],
135 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
136 |     ) {
137 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:135:35: error: value of type '_' expected to be instance of class or class-constrained type
133 |         anthropicVersion: String = "2023-06-01",
134 |         headers: [String: String] = [:],
135 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
136 |     ) {
137 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:192:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
190 |         anthropicVersion: String = "2023-06-01",
191 |         headers: [String: String] = [:],
192 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
193 |     ) {
194 |         self.http = AnthropicHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:192:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
190 |         anthropicVersion: String = "2023-06-01",
191 |         headers: [String: String] = [:],
192 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
193 |     ) {
194 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:192:35: error: value of type '_' expected to be instance of class or class-constrained type
190 |         anthropicVersion: String = "2023-06-01",
191 |         headers: [String: String] = [:],
192 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
193 |     ) {
194 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:37:23: error: cannot find 'URLRequest' in scope
 35 |             url = components.url ?? base
 36 |         }
 37 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
 38 |         request.httpMethod = method
 39 |         if !apiKey.isEmpty { request.setValue(apiKey, forHTTPHeaderField: "x-api-key") }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:60:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 58 |             urlRequest.httpBody = try JSONEncoder().encode(json)
 59 |         }
 60 |         let (data, response) = try await urlSession.data(for: urlRequest)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 61 |         try Self.check(response, data)
 62 |         return data.isEmpty ? .object([:]) : try JSONDecoder().decode(JSONValue.self, from: data)
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:68:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 66 |         _ method: String, _ path: String, beta: [String] = []
 67 |     ) async throws -> [JSONValue] {
 68 |         let (bytes, response) = try await urlSession.bytes(
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 69 |             for: request(method, path, beta: beta)
 70 |         )
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:78:63: error: cannot infer contextual base in reference to member 'utf8'
 76 |         var results: [JSONValue] = []
 77 |         for try await line in bytes.lines {
 78 |             guard !line.isEmpty, let data = line.data(using: .utf8),
    |                                                               `- error: cannot infer contextual base in reference to member 'utf8'
 79 |                   let value = try? JSONDecoder().decode(JSONValue.self, from: data)
 80 |             else { continue }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:87:32: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 89 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:87:36: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                    `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 89 |         }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
  |                  `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:87:80: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                                                                `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 89 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:88:45: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
    |                                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 89 |         }
 90 |     }
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:13:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
11 |     public var useDeploymentBasedUrls: Bool
12 |     public var headers: [String: String]
13 |     private let urlSession: URLSession
   |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
14 |
15 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
23 |     ) {
24 |         self.resourceName = resourceName
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
23 |     ) {
24 |         self.resourceName = resourceName
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:35: error: value of type '_' expected to be instance of class or class-constrained type
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
23 |     ) {
24 |         self.resourceName = resourceName
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:13:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AzureOpenAIProvider' has non-Sendable type 'AnyObject'
11 |     public var useDeploymentBasedUrls: Bool
12 |     public var headers: [String: String]
13 |     private let urlSession: URLSession
   |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AzureOpenAIProvider' has non-Sendable type 'AnyObject'
14 |
15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:35: error: value of type '_' expected to be instance of class or class-constrained type
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:54: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                      `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:68: error: value of type '_' expected to be instance of class or class-constrained type
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                                    `- error: value of type '_' expected to be instance of class or class-constrained type
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:68: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                                    `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:11:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  9 |     public var baseURL: URL?
 10 |     public var headers: [String: String]
 11 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 |
 13 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     ) {
 20 |         self.region = region
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 19 |     ) {
 20 |         self.region = region
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:35: error: value of type '_' expected to be instance of class or class-constrained type
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 19 |     ) {
 20 |         self.region = region
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:11:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockMantleProvider' has non-Sendable type 'AnyObject'
  9 |     public var baseURL: URL?
 10 |     public var headers: [String: String]
 11 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockMantleProvider' has non-Sendable type 'AnyObject'
 12 |
 13 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:20:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     private let baseURL: URL
 19 |     private let headers: [String: String]
 20 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |
 22 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 32 |     ) {
 33 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:35: error: value of type '_' expected to be instance of class or class-constrained type
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:76:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
 74 |
 75 |     private static func pumpEvents(
 76 |         from bytes: URLSession.AsyncBytes,
    |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
 77 |         isForcedJSON: Bool,
 78 |         into continuation: AsyncThrowingStream<StreamPart, Error>.Continuation
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:191:69: error: cannot find type 'URLRequest' in scope
189 |     static let jsonToolName = "json"
190 |
191 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
192 |         guard let url = URL(
193 |             string: "\(baseURL.absoluteString)/model/\(Self.encodeModelID(modelID))/converse-stream"
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:215:40: error: cannot find type 'URLRequest' in scope
213 |     }
214 |
215 |     func signSigV4(_ urlRequest: inout URLRequest, url: URL, body: Data) throws {
    |                                        `- error: cannot find type 'URLRequest' in scope
216 |         #if canImport(CryptoKit)
217 |         guard let host = url.host else {
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:20:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockModel' has non-Sendable type 'AnyObject'
 18 |     private let baseURL: URL
 19 |     private let headers: [String: String]
 20 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockModel' has non-Sendable type 'AnyObject'
 21 |
 22 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:54:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 52 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 53 |         let urlRequest = try buildURLRequest(request)
 54 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 55 |
 56 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
/host/spi-builder-workspace/Sources/AI/Streaming/AWSEventStream.swift:149:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
147 | enum AWSEventStream {
148 |     static func messages(
149 |         from bytes: URLSession.AsyncBytes
    |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
150 |     ) -> AsyncThrowingStream<AWSEventStreamMessage, Error> {
151 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:198:26: error: cannot find 'URLRequest' in scope
196 |         }
197 |
198 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
199 |         urlRequest.httpMethod = "POST"
200 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
[128/136] Compiling AI BedrockModel.swift
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:118:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
116 |     private let headers: [String: String]
117 |     private let auth: MCPOAuthSession?
118 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
119 |     private var sessionID: String?
120 |
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:125:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
123 |         headers: [String: String] = [:],
124 |         auth: MCPOAuthSession? = nil,
125 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
126 |     ) {
127 |         self.url = url
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:125:35: error: value of type '_' expected to be instance of class or class-constrained type
123 |         headers: [String: String] = [:],
124 |         auth: MCPOAuthSession? = nil,
125 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
126 |     ) {
127 |         self.url = url
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:125:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
123 |         headers: [String: String] = [:],
124 |         auth: MCPOAuthSession? = nil,
125 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
126 |     ) {
127 |         self.url = url
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:183:63: error: cannot find type 'URLRequest' in scope
181 |     }
182 |
183 |     private func makeRequest(body: JSONValue) async throws -> URLRequest {
    |                                                               `- error: cannot find type 'URLRequest' in scope
184 |         var urlRequest = URLRequest(url: url)
185 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:140:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
138 |             "params": params
139 |         ])
140 |         var (data, response) = try await urlSession.data(for: try await makeRequest(body: body))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
141 |         guard var http = response as? HTTPURLResponse else {
142 |             throw AIError.transport("MCP transport got a non-HTTP response")
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:153:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
151 |                 )
152 |             }
153 |             (data, response) = try await urlSession.data(for: try await makeRequest(body: body))
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
154 |             guard let retried = response as? HTTPURLResponse else {
155 |                 throw AIError.transport("MCP transport got a non-HTTP response")
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:180:35: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
178 |         ])
179 |         guard let request = try? await makeRequest(body: body) else { return }
180 |         _ = try? await urlSession.data(for: request)
    |                                   `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
181 |     }
182 |
/host/spi-builder-workspace/Sources/AI/MCP/MCPClient.swift:184:26: error: cannot find 'URLRequest' in scope
182 |
183 |     private func makeRequest(body: JSONValue) async throws -> URLRequest {
184 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
185 |         urlRequest.httpMethod = "POST"
186 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:150:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
148 |         for serverURL: URL,
149 |         wwwAuthenticate: String? = nil,
150 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
151 |     ) async throws -> (
152 |         authorizationServer: MCPAuthorizationServerMetadata,
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:150:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
148 |         for serverURL: URL,
149 |         wwwAuthenticate: String? = nil,
150 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
151 |     ) async throws -> (
152 |         authorizationServer: MCPAuthorizationServerMetadata,
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:150:35: error: value of type '_' expected to be instance of class or class-constrained type
148 |         for serverURL: URL,
149 |         wwwAuthenticate: String? = nil,
150 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
151 |     ) async throws -> (
152 |         authorizationServer: MCPAuthorizationServerMetadata,
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:175:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
173 |         for serverURL: URL,
174 |         wwwAuthenticate: String? = nil,
175 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
176 |     ) async throws -> MCPProtectedResourceMetadata {
177 |         var candidates: [URL] = []
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:175:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
173 |         for serverURL: URL,
174 |         wwwAuthenticate: String? = nil,
175 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
176 |     ) async throws -> MCPProtectedResourceMetadata {
177 |         var candidates: [URL] = []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:175:35: error: value of type '_' expected to be instance of class or class-constrained type
173 |         for serverURL: URL,
174 |         wwwAuthenticate: String? = nil,
175 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
176 |     ) async throws -> MCPProtectedResourceMetadata {
177 |         var candidates: [URL] = []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:311:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
309 |     public static func discoverAuthorizationServerMetadata(
310 |         issuer: URL,
311 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
312 |     ) async throws -> MCPAuthorizationServerMetadata {
313 |         guard isSecureEndpoint(issuer) else {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:311:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
309 |     public static func discoverAuthorizationServerMetadata(
310 |         issuer: URL,
311 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
312 |     ) async throws -> MCPAuthorizationServerMetadata {
313 |         guard isSecureEndpoint(issuer) else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:311:35: error: value of type '_' expected to be instance of class or class-constrained type
309 |     public static func discoverAuthorizationServerMetadata(
310 |         issuer: URL,
311 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
312 |     ) async throws -> MCPAuthorizationServerMetadata {
313 |         guard isSecureEndpoint(issuer) else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:337:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
335 |     public static func discoverAuthorizationServerMetadata(
336 |         for serverURL: URL,
337 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
338 |     ) async throws -> MCPAuthorizationServerMetadata {
339 |         try await discoverAuthorizationServerMetadata(issuer: serverURL, urlSession: urlSession)
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:337:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
335 |     public static func discoverAuthorizationServerMetadata(
336 |         for serverURL: URL,
337 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
338 |     ) async throws -> MCPAuthorizationServerMetadata {
339 |         try await discoverAuthorizationServerMetadata(issuer: serverURL, urlSession: urlSession)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:337:35: error: value of type '_' expected to be instance of class or class-constrained type
335 |     public static func discoverAuthorizationServerMetadata(
336 |         for serverURL: URL,
337 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
338 |     ) async throws -> MCPAuthorizationServerMetadata {
339 |         try await discoverAuthorizationServerMetadata(issuer: serverURL, urlSession: urlSession)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:342:60: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
340 |     }
341 |
342 |     private static func fetchJSON(at url: URL, urlSession: URLSession) async throws -> Data {
    |                                                            `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
343 |         var request = URLRequest(url: url)
344 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:353:54: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
351 |
352 |     private static func fetchAuthorizationServerMetadata(
353 |         at url: URL, issuer: URL? = nil, urlSession: URLSession
    |                                                      `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
354 |     ) async throws -> MCPAuthorizationServerMetadata {
355 |         var request = URLRequest(url: url)
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:408:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
406 |         metadata: MCPAuthorizationServerMetadata,
407 |         provider: any MCPOAuthClientProvider,
408 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
409 |     ) async throws -> MCPOAuthClientInformation {
410 |         if let existing = await provider.clientInformation() { return existing }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:408:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
406 |         metadata: MCPAuthorizationServerMetadata,
407 |         provider: any MCPOAuthClientProvider,
408 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
409 |     ) async throws -> MCPOAuthClientInformation {
410 |         if let existing = await provider.clientInformation() { return existing }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:408:35: error: value of type '_' expected to be instance of class or class-constrained type
406 |         metadata: MCPAuthorizationServerMetadata,
407 |         provider: any MCPOAuthClientProvider,
408 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
409 |     ) async throws -> MCPOAuthClientInformation {
410 |         if let existing = await provider.clientInformation() { return existing }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:519:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
517 |         provider: any MCPOAuthClientProvider,
518 |         resource: URL? = nil,
519 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
520 |     ) async throws -> MCPOAuthTokens {
521 |         guard let verifier = await provider.codeVerifier() else {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:519:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
517 |         provider: any MCPOAuthClientProvider,
518 |         resource: URL? = nil,
519 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
520 |     ) async throws -> MCPOAuthTokens {
521 |         guard let verifier = await provider.codeVerifier() else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:519:35: error: value of type '_' expected to be instance of class or class-constrained type
517 |         provider: any MCPOAuthClientProvider,
518 |         resource: URL? = nil,
519 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
520 |     ) async throws -> MCPOAuthTokens {
521 |         guard let verifier = await provider.codeVerifier() else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:546:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
544 |         provider: any MCPOAuthClientProvider,
545 |         resource: URL? = nil,
546 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
547 |     ) async throws -> MCPOAuthTokens {
548 |         let query = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)?.queryItems ?? []
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:546:35: error: value of type '_' expected to be instance of class or class-constrained type
544 |         provider: any MCPOAuthClientProvider,
545 |         resource: URL? = nil,
546 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
547 |     ) async throws -> MCPOAuthTokens {
548 |         let query = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)?.queryItems ?? []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:546:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
544 |         provider: any MCPOAuthClientProvider,
545 |         resource: URL? = nil,
546 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
547 |     ) async throws -> MCPOAuthTokens {
548 |         let query = URLComponents(url: callbackURL, resolvingAgainstBaseURL: false)?.queryItems ?? []
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:580:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
578 |         provider: any MCPOAuthClientProvider,
579 |         resource: URL? = nil,
580 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
581 |     ) async throws -> MCPOAuthTokens {
582 |         guard let refreshToken = tokens.refreshToken else {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:580:35: error: value of type '_' expected to be instance of class or class-constrained type
578 |         provider: any MCPOAuthClientProvider,
579 |         resource: URL? = nil,
580 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
581 |     ) async throws -> MCPOAuthTokens {
582 |         guard let refreshToken = tokens.refreshToken else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:580:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
578 |         provider: any MCPOAuthClientProvider,
579 |         resource: URL? = nil,
580 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
581 |     ) async throws -> MCPOAuthTokens {
582 |         guard let refreshToken = tokens.refreshToken else {
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:623:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
621 |         for serverURL: URL,
622 |         provider: any MCPOAuthClientProvider,
623 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
624 |     ) async throws -> MCPOAuthTokens? {
625 |         guard let tokens = await provider.tokens() else { return nil }
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:623:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
621 |         for serverURL: URL,
622 |         provider: any MCPOAuthClientProvider,
623 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
624 |     ) async throws -> MCPOAuthTokens? {
625 |         guard let tokens = await provider.tokens() else { return nil }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:623:35: error: value of type '_' expected to be instance of class or class-constrained type
621 |         for serverURL: URL,
622 |         provider: any MCPOAuthClientProvider,
623 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
624 |     ) async throws -> MCPOAuthTokens? {
625 |         guard let tokens = await provider.tokens() else { return nil }
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:648:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
646 |         clientInformation: MCPOAuthClientInformation,
647 |         params: [String: String],
648 |         urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
649 |     ) async throws -> MCPOAuthTokens {
650 |         var body = params
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:749:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
747 |     public let serverURL: URL
748 |     private let provider: any MCPOAuthClientProvider
749 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
750 |
751 |     private var authorizationServer: MCPAuthorizationServerMetadata?
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:757:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
755 |         serverURL: URL,
756 |         provider: any MCPOAuthClientProvider,
757 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
758 |     ) {
759 |         self.serverURL = serverURL
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:757:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
755 |         serverURL: URL,
756 |         provider: any MCPOAuthClientProvider,
757 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
758 |     ) {
759 |         self.serverURL = serverURL
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:757:35: error: value of type '_' expected to be instance of class or class-constrained type
755 |         serverURL: URL,
756 |         provider: any MCPOAuthClientProvider,
757 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
758 |     ) {
759 |         self.serverURL = serverURL
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:343:23: error: cannot find 'URLRequest' in scope
341 |
342 |     private static func fetchJSON(at url: URL, urlSession: URLSession) async throws -> Data {
343 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
344 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
345 |         let (data, response) = try await urlSession.data(for: request)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:345:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
343 |         var request = URLRequest(url: url)
344 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
345 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
346 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
347 |             throw AIError.transport("No metadata at \(url.absoluteString)")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:355:23: error: cannot find 'URLRequest' in scope
353 |         at url: URL, issuer: URL? = nil, urlSession: URLSession
354 |     ) async throws -> MCPAuthorizationServerMetadata {
355 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
356 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
357 |         let (data, response) = try await urlSession.data(for: request)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:357:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
355 |         var request = URLRequest(url: url)
356 |         request.setValue("application/json", forHTTPHeaderField: "Accept")
357 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
358 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
359 |             throw AIError.transport("No OAuth metadata at \(url.absoluteString)")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:417:23: error: cannot find 'URLRequest' in scope
415 |             )
416 |         }
417 |         var request = URLRequest(url: registrationEndpoint)
    |                       `- error: cannot find 'URLRequest' in scope
418 |         request.httpMethod = "POST"
419 |         request.setValue("application/json", forHTTPHeaderField: "Content-Type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:421:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
419 |         request.setValue("application/json", forHTTPHeaderField: "Content-Type")
420 |         request.httpBody = try JSONEncoder().encode(Self.registrationRequestBody(provider.clientMetadata))
421 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
422 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
423 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:423:72: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
421 |         let (data, response) = try await urlSession.data(for: request)
422 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
423 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
    |                                                                        `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
424 |         }
425 |         let info = try Self.parseClientRegistration(data)
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:655:23: error: cannot find 'URLRequest' in scope
653 |             body["client_secret"] = secret
654 |         }
655 |         var request = URLRequest(url: metadata.tokenEndpoint)
    |                       `- error: cannot find 'URLRequest' in scope
656 |         request.httpMethod = "POST"
657 |         request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:660:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
658 |         request.httpBody = Self.encodeFormBody(body)
659 |
660 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
661 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
662 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/MCP/MCPOAuth.swift:662:72: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
660 |         let (data, response) = try await urlSession.data(for: request)
661 |         guard let http = response as? HTTPURLResponse, (200..<300).contains(http.statusCode) else {
662 |             throw AIError.http(status: (response as? HTTPURLResponse)?.statusCode ?? 0, body: String(decoding: data, as: UTF8.self))
    |                                                                        `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
663 |         }
664 |         // Stamp the issuer so a later refresh can verify it hasn't been pointed
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:9:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  7 |     private let sseURL: URL
  8 |     private let headers: [String: String]
  9 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 10 |     private let requestTimeout: TimeInterval
 11 |
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:26:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 24 |         headers: [String: String] = [:],
 25 |         auth: MCPOAuthSession? = nil,
 26 |         urlSession: URLSession = .shared,
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 27 |         requestTimeout: TimeInterval = 60
 28 |     ) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:26:35: error: value of type '_' expected to be instance of class or class-constrained type
 24 |         headers: [String: String] = [:],
 25 |         auth: MCPOAuthSession? = nil,
 26 |         urlSession: URLSession = .shared,
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 27 |         requestTimeout: TimeInterval = 60
 28 |     ) {
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:26:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 24 |         headers: [String: String] = [:],
 25 |         auth: MCPOAuthSession? = nil,
 26 |         urlSession: URLSession = .shared,
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 27 |         requestTimeout: TimeInterval = 60
 28 |     ) {
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:89:27: error: cannot find 'URLRequest' in scope
 87 |     private func readLoop() async {
 88 |         do {
 89 |             var request = URLRequest(url: sseURL)
    |                           `- error: cannot find 'URLRequest' in scope
 90 |             request.setValue("text/event-stream", forHTTPHeaderField: "Accept")
 91 |             for (field, value) in headers { request.setValue(value, forHTTPHeaderField: field) }
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:95:58: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 93 |                 request.setValue(header, forHTTPHeaderField: "Authorization")
 94 |             }
 95 |             let (bytes, response) = try await urlSession.bytes(for: request)
    |                                                          `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 96 |             if let http = response as? HTTPURLResponse, http.statusCode == 401, let auth {
 97 |                 let challenge = http.value(forHTTPHeaderField: "WWW-Authenticate")
/host/spi-builder-workspace/Sources/AI/Streaming/SSE.swift:45:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
43 | enum SSE {
44 |     static func events(
45 |         from bytes: URLSession.AsyncBytes
   |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
46 |     ) -> AsyncThrowingStream<SSEEvent, Error> {
47 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:156:23: error: cannot find 'URLRequest' in scope
154 |
155 |     private func post(body: JSONValue, to endpoint: URL) async throws {
156 |         var request = URLRequest(url: endpoint)
    |                       `- error: cannot find 'URLRequest' in scope
157 |         request.httpMethod = "POST"
158 |         request.setValue("application/json", forHTTPHeaderField: "content-type")
/host/spi-builder-workspace/Sources/AI/MCP/MCPSSETransport.swift:164:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
162 |         }
163 |         request.httpBody = try JSONEncoder().encode(body)
164 |         let (data, response) = try await urlSession.data(for: request)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
165 |         guard let http = response as? HTTPURLResponse else {
166 |             throw AIError.transport("MCP SSE post got a non-HTTP response")
/host/spi-builder-workspace/Sources/AI/Providers/AIGatewayModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = aiGatewayConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AIGatewayModel.swift:19:35: error: value of type '_' expected to be instance of class or class-constrained type
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
20 |     ) {
21 |         engine = aiGatewayConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AIGatewayModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = aiGatewayConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
 18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
 19 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |     ) {
 21 |         engine = alibabaConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
 18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
 19 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 20 |     ) {
 21 |         engine = alibabaConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:19:35: error: value of type '_' expected to be instance of class or class-constrained type
 17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
 18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
 19 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 20 |     ) {
 21 |         engine = alibabaConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:36:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 34 |     private let dimension: Int?
 35 |     private let headers: [String: String]
 36 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 37 |
 38 |     static let maxTextsPerCall = 10
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:46:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 44 |         dimension: Int? = nil,
 45 |         headers: [String: String] = [:],
 46 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 47 |     ) {
 48 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:46:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 44 |         dimension: Int? = nil,
 45 |         headers: [String: String] = [:],
 46 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 47 |     ) {
 48 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:46:35: error: value of type '_' expected to be instance of class or class-constrained type
 44 |         dimension: Int? = nil,
 45 |         headers: [String: String] = [:],
 46 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 47 |     ) {
 48 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:75:55: error: cannot find type 'URLRequest' in scope
 73 |     }
 74 |
 75 |     func buildURLRequest(_ texts: [String]) throws -> URLRequest {
    |                                                       `- error: cannot find type 'URLRequest' in scope
 76 |         var parameters: [String: JSONValue] = [:]
 77 |         if let dimension { parameters["dimension"] = .number(Double(dimension)) }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:36:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaEmbeddingModel' has non-Sendable type 'AnyObject'
 34 |     private let dimension: Int?
 35 |     private let headers: [String: String]
 36 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaEmbeddingModel' has non-Sendable type 'AnyObject'
 37 |
 38 |     static let maxTextsPerCall = 10
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:103:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
101 |     private let baseURL: URL
102 |     private let headers: [String: String]
103 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
104 |     private let pollInterval: TimeInterval
105 |     private let pollTimeout: TimeInterval
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:114:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
112 |         pollInterval: TimeInterval = 5,
113 |         pollTimeout: TimeInterval = 600,
114 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
115 |     ) {
116 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:114:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
112 |         pollInterval: TimeInterval = 5,
113 |         pollTimeout: TimeInterval = 600,
114 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
115 |     ) {
116 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:114:35: error: value of type '_' expected to be instance of class or class-constrained type
112 |         pollInterval: TimeInterval = 5,
113 |         pollTimeout: TimeInterval = 600,
114 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
115 |     ) {
116 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:160:69: error: cannot find type 'URLRequest' in scope
158 |     }
159 |
160 |     func buildCreateRequest(_ request: VideoModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
161 |         var input: [String: JSONValue] = ["prompt": .string(request.prompt)]
162 |         if let image = request.image {
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:103:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaVideoModel' has non-Sendable type 'AnyObject'
101 |     private let baseURL: URL
102 |     private let headers: [String: String]
103 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AlibabaVideoModel' has non-Sendable type 'AnyObject'
104 |     private let pollInterval: TimeInterval
105 |     private let pollTimeout: TimeInterval
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:61:57: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 59 |         for start in stride(from: 0, to: texts.count, by: Self.maxTextsPerCall) {
 60 |             let batch = Array(texts[start..<min(start + Self.maxTextsPerCall, texts.count)])
 61 |             let (data, response) = try await urlSession.data(for: try buildURLRequest(batch))
    |                                                         `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 62 |             if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 63 |                 throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:66:26: error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
 64 |             }
 65 |             let decoded = try JSONDecoder().decode(JSONValue.self, from: data)
 66 |             let sorted = (decoded["output"]?["embeddings"]?.arrayValue ?? []).sorted {
    |                          `- error: the compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions
 67 |                 ($0["text_index"]?.intValue ?? 0) < ($1["text_index"]?.intValue ?? 0)
 68 |             }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:69:76: error: value of type '[Any]??' has no member 'compactMap'
 67 |                 ($0["text_index"]?.intValue ?? 0) < ($1["text_index"]?.intValue ?? 0)
 68 |             }
 69 |             embeddings += sorted.map { ($0["embedding"]?.arrayValue ?? []).compactMap(\.doubleValue) }
    |                                                                            `- error: value of type '[Any]??' has no member 'compactMap'
 70 |             usage = usage + Usage(inputTokens: decoded["usage"]?["total_tokens"]?.intValue ?? 0)
 71 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:69:87: error: cannot infer key path type from context; consider explicitly specifying a root type
 67 |                 ($0["text_index"]?.intValue ?? 0) < ($1["text_index"]?.intValue ?? 0)
 68 |             }
 69 |             embeddings += sorted.map { ($0["embedding"]?.arrayValue ?? []).compactMap(\.doubleValue) }
    |                                                                                       `- error: cannot infer key path type from context; consider explicitly specifying a root type
 70 |             usage = usage + Usage(inputTokens: decoded["usage"]?["total_tokens"]?.intValue ?? 0)
 71 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:84:26: error: cannot find 'URLRequest' in scope
 82 |         ])
 83 |
 84 |         var urlRequest = URLRequest(
    |                          `- error: cannot find 'URLRequest' in scope
 85 |             url: baseURL.appendingPathComponent("services/embeddings/text-embedding/text-embedding")
 86 |         )
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:126:65: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
124 |
125 |     public func generateVideos(_ request: VideoModelRequest) async throws -> VideoModelResponse {
126 |         let (createData, createResponse) = try await urlSession.data(for: try buildCreateRequest(request))
    |                                                                 `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
127 |         if let http = createResponse as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
128 |             throw AIError.http(status: http.statusCode, body: String(decoding: createData, as: UTF8.self))
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:139:24: error: cannot find 'URLRequest' in scope
137 |             try await Task.sleep(nanoseconds: pollNanoseconds(pollInterval))
138 |             if Date() > deadline { throw AIError.transport("Alibaba video generation timed out") }
139 |             var poll = URLRequest(url: baseURL.appendingPathComponent("api/v1/tasks/\(taskID)"))
    |                        `- error: cannot find 'URLRequest' in scope
140 |             poll.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
141 |             for (field, value) in headers { poll.setValue(value, forHTTPHeaderField: field) }
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:142:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
140 |             poll.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")
141 |             for (field, value) in headers { poll.setValue(value, forHTTPHeaderField: field) }
142 |             let (pollData, _) = try await urlSession.data(for: poll)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
143 |             let status = try JSONDecoder().decode(JSONValue.self, from: pollData)
144 |             switch status["output"]?["task_status"]?.stringValue {
/host/spi-builder-workspace/Sources/AI/Providers/AlibabaModel.swift:176:26: error: cannot find 'URLRequest' in scope
174 |         }
175 |
176 |         var urlRequest = URLRequest(
    |                          `- error: cannot find 'URLRequest' in scope
177 |             url: baseURL.appendingPathComponent("api/v1/services/aigc/video-generation/video-synthesis")
178 |         )
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:14:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 |     let anthropicVersion: String
 13 |     let headers: [String: String]
 14 |     let urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 15 |
 16 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:22:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 20 |         anthropicVersion: String = "2023-06-01",
 21 |         headers: [String: String] = [:],
 22 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 23 |     ) {
 24 |         self.init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:22:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 20 |         anthropicVersion: String = "2023-06-01",
 21 |         headers: [String: String] = [:],
 22 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 23 |     ) {
 24 |         self.init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:22:35: error: value of type '_' expected to be instance of class or class-constrained type
 20 |         anthropicVersion: String = "2023-06-01",
 21 |         headers: [String: String] = [:],
 22 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 23 |     ) {
 24 |         self.init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:41:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 39 |         anthropicVersion: String,
 40 |         headers: [String: String],
 41 |         urlSession: URLSession,
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 42 |         providerName: String
 43 |     ) {
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:156:69: error: cannot find type 'URLRequest' in scope
154 |     }
155 |
156 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
157 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent("messages"))
158 |         urlRequest.httpMethod = "POST"
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:14:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicModel' has non-Sendable type 'AnyObject'
 12 |     let anthropicVersion: String
 13 |     let headers: [String: String]
 14 |     let urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicModel' has non-Sendable type 'AnyObject'
 15 |
 16 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:57:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 55 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 56 |         let urlRequest = try buildURLRequest(request)
 57 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 58 |
 59 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicModel.swift:157:26: error: cannot find 'URLRequest' in scope
155 |
156 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
157 |         var urlRequest = URLRequest(url: baseURL.appendingPathComponent("messages"))
    |                          `- error: cannot find 'URLRequest' in scope
158 |         urlRequest.httpMethod = "POST"
159 |         urlRequest.setValue(apiKey, forHTTPHeaderField: "x-api-key")
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:11:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  9 |     var anthropicVersion: String
 10 |     var headers: [String: String]
 11 |     var urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 |
 13 |     init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:18:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 16 |         anthropicVersion: String,
 17 |         headers: [String: String],
 18 |         urlSession: URLSession
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     ) {
 20 |         self.apiKey = apiKey ?? ProcessInfo.processInfo.environment["ANTHROPIC_API_KEY"] ?? ""
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:29:10: error: cannot find type 'URLRequest' in scope
 27 |     func request(
 28 |         _ method: String, _ path: String, query: [String: String] = [:], beta: [String] = []
 29 |     ) -> URLRequest {
    |          `- error: cannot find type 'URLRequest' in scope
 30 |         let base = baseURL.appendingPathComponent(path)
 31 |         var url = base
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:86:35: error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 84 |     }
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
    |                                   `- error: 'URLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
Foundation.URLResponse:2:18: note: 'URLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLResponse = AnyObject
  |                  `- note: 'URLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:11:9: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicHTTP' has non-Sendable type 'AnyObject'
  9 |     var anthropicVersion: String
 10 |     var headers: [String: String]
 11 |     var urlSession: URLSession
    |         `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AnthropicHTTP' has non-Sendable type 'AnyObject'
 12 |
 13 |     init(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:135:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
133 |         anthropicVersion: String = "2023-06-01",
134 |         headers: [String: String] = [:],
135 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
136 |     ) {
137 |         self.http = AnthropicHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:135:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
133 |         anthropicVersion: String = "2023-06-01",
134 |         headers: [String: String] = [:],
135 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
136 |     ) {
137 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:135:35: error: value of type '_' expected to be instance of class or class-constrained type
133 |         anthropicVersion: String = "2023-06-01",
134 |         headers: [String: String] = [:],
135 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
136 |     ) {
137 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:192:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
190 |         anthropicVersion: String = "2023-06-01",
191 |         headers: [String: String] = [:],
192 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
193 |     ) {
194 |         self.http = AnthropicHTTP(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:192:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
190 |         anthropicVersion: String = "2023-06-01",
191 |         headers: [String: String] = [:],
192 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
193 |     ) {
194 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:192:35: error: value of type '_' expected to be instance of class or class-constrained type
190 |         anthropicVersion: String = "2023-06-01",
191 |         headers: [String: String] = [:],
192 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
193 |     ) {
194 |         self.http = AnthropicHTTP(
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:37:23: error: cannot find 'URLRequest' in scope
 35 |             url = components.url ?? base
 36 |         }
 37 |         var request = URLRequest(url: url)
    |                       `- error: cannot find 'URLRequest' in scope
 38 |         request.httpMethod = method
 39 |         if !apiKey.isEmpty { request.setValue(apiKey, forHTTPHeaderField: "x-api-key") }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:60:53: error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 58 |             urlRequest.httpBody = try JSONEncoder().encode(json)
 59 |         }
 60 |         let (data, response) = try await urlSession.data(for: urlRequest)
    |                                                     `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'data'
 61 |         try Self.check(response, data)
 62 |         return data.isEmpty ? .object([:]) : try JSONDecoder().decode(JSONValue.self, from: data)
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:68:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 66 |         _ method: String, _ path: String, beta: [String] = []
 67 |     ) async throws -> [JSONValue] {
 68 |         let (bytes, response) = try await urlSession.bytes(
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 69 |             for: request(method, path, beta: beta)
 70 |         )
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:78:63: error: cannot infer contextual base in reference to member 'utf8'
 76 |         var results: [JSONValue] = []
 77 |         for try await line in bytes.lines {
 78 |             guard !line.isEmpty, let data = line.data(using: .utf8),
    |                                                               `- error: cannot infer contextual base in reference to member 'utf8'
 79 |                   let value = try? JSONDecoder().decode(JSONValue.self, from: data)
 80 |             else { continue }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:87:32: warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                `- warning: conditional cast from 'URLResponse' (aka 'AnyObject') to 'HTTPURLResponse' (aka 'AnyObject') always succeeds
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 89 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:87:36: error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                    `- error: 'HTTPURLResponse' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 89 |         }
Foundation.HTTPURLResponse:2:18: note: 'HTTPURLResponse' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias HTTPURLResponse = AnyObject
  |                  `- note: 'HTTPURLResponse' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:87:80: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 85 |
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
    |                                                                                `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
 89 |         }
/host/spi-builder-workspace/Sources/AI/Providers/AnthropicPlatformClients.swift:88:45: error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 86 |     static func check(_ response: URLResponse, _ data: Data) throws {
 87 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
 88 |             throw AIError.http(status: http.statusCode, body: String(decoding: data, as: UTF8.self))
    |                                             `- error: value of type 'HTTPURLResponse' (aka 'AnyObject') has no member 'statusCode'
 89 |         }
 90 |     }
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:13:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
11 |     public var useDeploymentBasedUrls: Bool
12 |     public var headers: [String: String]
13 |     private let urlSession: URLSession
   |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
14 |
15 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
23 |     ) {
24 |         self.resourceName = resourceName
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
23 |     ) {
24 |         self.resourceName = resourceName
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:22:35: error: value of type '_' expected to be instance of class or class-constrained type
20 |         useDeploymentBasedUrls: Bool = false,
21 |         headers: [String: String] = [:],
22 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
23 |     ) {
24 |         self.resourceName = resourceName
/host/spi-builder-workspace/Sources/AI/Providers/AzureOpenAIProvider.swift:13:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'AzureOpenAIProvider' has non-Sendable type 'AnyObject'
11 |     public var useDeploymentBasedUrls: Bool
12 |     public var headers: [String: String]
13 |     private let urlSession: URLSession
   |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'AzureOpenAIProvider' has non-Sendable type 'AnyObject'
14 |
15 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:19:35: error: value of type '_' expected to be instance of class or class-constrained type
17 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
18 |         headers: [String: String] = [:], queryParams: [String: String] = [:],
19 |         urlSession: URLSession = .shared
   |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
20 |     ) {
21 |         engine = basetenConfiguration.makeModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:54: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                      `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:68: error: value of type '_' expected to be instance of class or class-constrained type
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                                    `- error: value of type '_' expected to be instance of class or class-constrained type
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
/host/spi-builder-workspace/Sources/AI/Providers/BasetenModel.swift:33:68: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
31 |     public init(
32 |         _ modelID: String, apiKey: String? = nil, baseURL: URL? = nil,
33 |         headers: [String: String] = [:], urlSession: URLSession = .shared
   |                                                                    `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
34 |     ) {
35 |         engine = basetenConfiguration.makeEmbeddingModel(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:11:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
  9 |     public var baseURL: URL?
 10 |     public var headers: [String: String]
 11 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 12 |
 13 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 19 |     ) {
 20 |         self.region = region
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 19 |     ) {
 20 |         self.region = region
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:18:35: error: value of type '_' expected to be instance of class or class-constrained type
 16 |         baseURL: URL? = nil,
 17 |         headers: [String: String] = [:],
 18 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 19 |     ) {
 20 |         self.region = region
/host/spi-builder-workspace/Sources/AI/Providers/BedrockMantleProvider.swift:11:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockMantleProvider' has non-Sendable type 'AnyObject'
  9 |     public var baseURL: URL?
 10 |     public var headers: [String: String]
 11 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockMantleProvider' has non-Sendable type 'AnyObject'
 12 |
 13 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:20:29: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 18 |     private let baseURL: URL
 19 |     private let headers: [String: String]
 20 |     private let urlSession: URLSession
    |                             `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 21 |
 22 |     public init(
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:21: error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                     `- error: 'URLSession' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.
 32 |     ) {
 33 |         self.modelID = modelID
Foundation.URLSession:2:18: note: 'URLSession' has been explicitly marked unavailable here
1 | @available(*, unavailable, message: "This type has moved to the FoundationNetworking module. Import that module to use it.")
2 | public typealias URLSession = AnyObject
  |                  `- note: 'URLSession' has been explicitly marked unavailable here
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:35: error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: type 'URLSession' (aka 'AnyObject') has no member 'shared'
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:31:35: error: value of type '_' expected to be instance of class or class-constrained type
 29 |         baseURL: URL? = nil,
 30 |         headers: [String: String] = [:],
 31 |         urlSession: URLSession = .shared
    |                                   `- error: value of type '_' expected to be instance of class or class-constrained type
 32 |     ) {
 33 |         self.modelID = modelID
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:76:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
 74 |
 75 |     private static func pumpEvents(
 76 |         from bytes: URLSession.AsyncBytes,
    |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
 77 |         isForcedJSON: Bool,
 78 |         into continuation: AsyncThrowingStream<StreamPart, Error>.Continuation
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:191:69: error: cannot find type 'URLRequest' in scope
189 |     static let jsonToolName = "json"
190 |
191 |     func buildURLRequest(_ request: LanguageModelRequest) throws -> URLRequest {
    |                                                                     `- error: cannot find type 'URLRequest' in scope
192 |         guard let url = URL(
193 |             string: "\(baseURL.absoluteString)/model/\(Self.encodeModelID(modelID))/converse-stream"
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:215:40: error: cannot find type 'URLRequest' in scope
213 |     }
214 |
215 |     func signSigV4(_ urlRequest: inout URLRequest, url: URL, body: Data) throws {
    |                                        `- error: cannot find type 'URLRequest' in scope
216 |         #if canImport(CryptoKit)
217 |         guard let host = url.host else {
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:20:17: error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockModel' has non-Sendable type 'AnyObject'
 18 |     private let baseURL: URL
 19 |     private let headers: [String: String]
 20 |     private let urlSession: URLSession
    |                 `- error: stored property 'urlSession' of 'Sendable'-conforming struct 'BedrockModel' has non-Sendable type 'AnyObject'
 21 |
 22 |     public init(
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:54:54: error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 52 |     ) async throws -> AsyncThrowingStream<StreamPart, Error> {
 53 |         let urlRequest = try buildURLRequest(request)
 54 |         let (bytes, response) = try await urlSession.bytes(for: urlRequest)
    |                                                      `- error: value of type 'URLSession' (aka 'AnyObject') has no member 'bytes'
 55 |
 56 |         if let http = response as? HTTPURLResponse, !(200..<300).contains(http.statusCode) {
/host/spi-builder-workspace/Sources/AI/Streaming/AWSEventStream.swift:149:32: error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
147 | enum AWSEventStream {
148 |     static func messages(
149 |         from bytes: URLSession.AsyncBytes
    |                                `- error: 'AsyncBytes' is not a member type of type 'Foundation.URLSession' (aka 'AnyObject')
150 |     ) -> AsyncThrowingStream<AWSEventStreamMessage, Error> {
151 |         AsyncThrowingStream { continuation in
/host/spi-builder-workspace/Sources/AI/Providers/BedrockModel.swift:198:26: error: cannot find 'URLRequest' in scope
196 |         }
197 |
198 |         var urlRequest = URLRequest(url: url)
    |                          `- error: cannot find 'URLRequest' in scope
199 |         urlRequest.httpMethod = "POST"
200 |         urlRequest.setValue("application/json", forHTTPHeaderField: "content-type")
BUILD FAILURE 6.3 wasm