Files
web-terminal/ios/Packages/WireProtocol/Sources/WireProtocol/HTTPTransport.swift
Yaojia Wang cbaa08daba feat(ios): W0 scaffold + day-1 spike + WireProtocol frozen contract + TestSupport doubles
T-iOS-1: ios/ XcodeGen project (iOS 17, Swift 6 strict concurrency, ATS per PLAN §5.2), 5 SPM package shells, CI skeleton
T-iOS-2: Origin spike vs real server — URLSessionWebSocketTask custom Origin CONFIRMED (no Starscream); 16MiB replay + EMSGSIZE(40) errno correction written back to plan
T-iOS-3: WireProtocol frozen contract, 59 tests, 100% line coverage, cross-impl vectors vs src/protocol.ts via tsx
T-iOS-4: FakeTransport/FakeClock/FakeHTTPTransport doubles
Verify: independent agent re-ran all acceptance — 6/6 PASS
2026-07-04 21:19:30 +02:00

14 lines
672 B
Swift

import Foundation
/// Thin HTTP I/O boundary (frozen contract, plan §3.1). `APIClient` builds
/// `URLRequest`s (Origin stamped iff the endpoint is a mutating `G` route,
/// plan §3.4 ) and sends them through this seam; the production
/// implementation wraps `URLSession`, `FakeHTTPTransport` (TestSupport)
/// queues canned responses.
public protocol HTTPTransport: Sendable {
/// Perform one HTTP exchange. Implementations throw on transport-level
/// failure; non-2xx statuses are returned, not thrown classification
/// (e.g. `PairingError`) is the caller's job.
func send(_ request: URLRequest) async throws -> (Data, HTTPURLResponse)
}