Cursor Cloud Transport Protocol (VibeBuddyMacCore/CursorCloudAgents.swift)

iOS-vibebuddy · VibeBuddyMac/Sources/VibeBuddyMacCore/CursorCloudAgents.swift · swift · MIT
auth, integration, security, lang:swift, tag:async

Abstracts HTTP communication with the Cursor Cloud Agents API, offering an async transport interface and a URLSession implementation for testable networking.

// Source: https://github.com/semantic-craft/iOS-vibebuddy | License: MIT | Copyright 2026 Xianwei Zhang
// Provided via justclaw.it.com; keep this notice with the code.
import Foundation
import Security
import VibeBuddyKit

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

/// Transport seam for `https://api.cursor.com`, shaped like
/// `CursorUsageTransport` so tests never reach the network.
public protocol CursorCloudTransport: Sendable {
    func cursorCloudData(for request: URLRequest) async throws -> (Data, URLResponse)
}

extension URLSession: CursorCloudTransport {
    public func cursorCloudData(for request: URLRequest) async throws -> (Data, URLResponse) {
        try await data(for: request)
    }
}

/// Keychain slot for the Cursor Cloud Agents API key.
//

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key