// ABI Hash: c3567b13df17c4f8ff5222c9bfe3356845cd03621eafb10fd2bdd2b9ceb0f38c import Foundation import FactoryKit import Combine import OSLog import Network import CacheKit import Security public struct DriveFileMetadata: Codable, Sendable { public let id: String = "" public let name: String? = nil public let modifiedTime: String? = nil public let size: String? = nil public let md5Checksum: String? = nil public let parents: [String]? = nil } public struct DriveChannel: Codable, Sendable { public let id: String? = nil public let type: String? = nil public let address: String? = nil public let token: String? = nil public let expiration: String? = nil public let resourceId: String? = nil public let resourceUri: String? = nil } public class DriveAPI { public static func fetchMetadata(fileId: String, accessToken: String) async throws -> DriveFileMetadata { fatalError() } public static func watch(fileId: String, accessToken: String, channelId: String, address: String, token: String? = nil) async throws -> DriveChannel { fatalError() } public static func stopChannel(channelId: String, resourceId: String, accessToken: String) async throws { fatalError() } /// Sets link-sharing permissions on a file or folder to make it publicly readable. /// - Parameters: /// - fileOrFolderId: The ID of the file or folder to set permissions on. /// - accessToken: The OAuth access token for authentication. public static func setLinkSharingPermission(fileOrFolderId: String, accessToken: String) async throws { fatalError() } /// Resolves the owner account email for a given file by probing authenticated accounts. /// - Parameter fileId: The ID of the file to check ownership for. /// - Returns: The email address of the account that owns the file. /// - Throws: An error if no authenticated accounts are available or if the owner cannot be identified. public static func resolveOwner(for fileId: String) async throws -> String { fatalError() } /// Resolves or creates the Factory_Chat_Images folder for a given account. /// - Parameter accountEmail: The email of the account to use. /// - Returns: The folder ID of the Factory_Chat_Images folder. public static func resolveOrCreateFactoryChatImagesFolder(accountEmail: String) async throws -> String { fatalError() } /// Stages a chat image by resolving owner, folder, renaming, and moving in one call. /// Uses 100% local FileManager operations for naming and folder relocation. /// - Parameters: /// - fileId: The ID of the file to stage. /// - preferredExtension: The preferred file extension (default: "png"). /// - Returns: The final updated DriveFileMetadata. public static func stageChatImage(fileId: String, preferredExtension: String = "png") async throws -> DriveFileMetadata { fatalError() } } @MainActor public class DriveAuthManager: ObservableObject { public static let shared = DriveAuthManager() public let clientID = "415049535592-mpccenk36gpag4s39skq1tu50is8273g.apps.googleusercontent.com" public let reversedClientID = "com.googleusercontent.apps.415049535592-mpccenk36gpag4s39skq1tu50is8273g" public let redirectURI = "com.googleusercontent.apps.415049535592-mpccenk36gpag4s39skq1tu50is8273g:/oauth2callback" public let oauthPort: UInt16 = 8080 @Published public var authenticatedAccounts: [String] = [] public init() { fatalError() } public func getAuthURL() -> URL { fatalError() } /// Starts a local HTTP loopback server using NWListener to capture the OAuth authorization code. public func startLoopbackListener(port: UInt16 = 8080) async throws -> String { fatalError() } /// Stops and tears down the active NWListener loopback server. public func stopLoopbackListener() { fatalError() } /// Backwards compatibility / convenience method for starting server. public func startServer(port: UInt16 = 8080) async throws -> String { fatalError() } /// Backwards compatibility / convenience method for stopping server. public func stopServer() { fatalError() } public func exchangeCodeForToken(code: String) async throws { fatalError() } public func getAccessToken(for email: String) async throws -> String { fatalError() } public func loadSavedAccounts() { fatalError() } public func clearAccount(email: String) { fatalError() } } @MainActor public class DriveSyncEngine: ObservableObject { public static let shared = DriveSyncEngine() @Published public var tunnelStatus: String = "Idle" @Published public var isEngineRunning: Bool = false @Published public var filterActiveOnly: Bool = false { didSet { fatalError() } } @Published public var activeChatIDs: Set = [] @Published public var monitoredFiles: [String: MonitoredFile] = [:] public struct MonitoredFile: Identifiable, Sendable, Codable { public var id: String { fatalError() } public let fileID: String public let accountEmail: String public let agentName: String public var md5Checksum: String? = nil public var expirationDate: Date? = nil public var status: String = "Idle" public var lastUpdate: Date = Date() public var isAuxiliary: Bool = false public var ownerApp: String? = nil public var notifyChannel: String? = nil public init( fileID: String, accountEmail: String, agentName: String, md5Checksum: String? = nil, expirationDate: Date? = nil, status: String = "Idle", lastUpdate: Date = Date(), isAuxiliary: Bool = false, ownerApp: String? = nil, notifyChannel: String? = nil ) { fatalError() } } public init() { fatalError() } public func startEngine() { fatalError() } public func stopEngine() { fatalError() } public func fetchCloudMD5(for chatID: String, accountEmail: String) async throws -> String { fatalError() } public func startTunnelMonitor() { fatalError() } public func stopTunnelMonitor() { fatalError() } public func startRenewalMonitor() { fatalError() } public func stopRenewalMonitor() { fatalError() } public func testTunnel() { fatalError() } } @MainActor public class DriveWebhookReceiver { public static let shared = DriveWebhookReceiver() public var isRunning = false public init() { fatalError() } public func start(port: in_port_t = 5050) { fatalError() } public func stop() { fatalError() } } public struct KeychainHelper: Sendable { public static let shared = KeychainHelper() public func save(_ data: Data, service: String, account: String) { fatalError() } public func read(service: String, account: String) -> Data? { fatalError() } public func delete(service: String, account: String) { fatalError() } }