Repository Public
1// Author: Simon-Pierre Boucher — contact@spboucher.ai2// File: Sources/VQuantKit/VQuantKit.swift3// Description: The entry point: every client of the package over one transport.4import Foundation56/// Everything backend 6 ("VQuant Next") adds, over one `VQTransport`.7///8/// ```swift9/// let vq = VQuantAPI(transport: MyAppTransport(client: apiClient))10/// let overview = try await vq.data.marketOverview()11/// let engine = VQSyncEngine(client: vq.client, storage: try VQFileSyncStorage(directory: dir))12/// ```13///14/// A later contract section (§9 "Autonomous research") becomes one more struct of this shape — a file in a new15/// folder, a property here — without touching the others.16public struct VQuantAPI: Sendable {17 /// The version of the backend contract this package was written against.18 public static let contractVersion = "6.0"19 /// First client version that receives every lab engine and the `cancelled` job status (CONTRACT §4.1).20 public static let minimumNextClientVersion = "2.0.0"2122 public let client: VQClient23 public let clock: any VQClock24 public init(transport: any VQTransport, clock: any VQClock = VQSystemClock()) {25 self.client = VQClient(transport: transport); self.clock = clock26 }2728 public var objects: VQObjectStoreClient { VQObjectStoreClient(client: client) }29 public var models: VQModelsClient { VQModelsClient(client: client) }30 public var data: VQDataClient { VQDataClient(client: client) }31 public var lab: VQLabClient { VQLabClient(client: client, clock: clock) }32 public var research: VQResearchClient { VQResearchClient(client: client) }3334 /// The value of `X-VQ-Client` for each platform.35 public static func macClientHeader(version: String) -> String { "vquant-macos/\(version)" }36 public static func iosClientHeader(version: String, build: String) -> String { "vquant-ios/\(version) (\(build))" }37}38