// ABI Hash: af5214dd05e6598656bbc6a5dfc66b3ade9294c1c691f643b93e6de3b6cbfc88 import Foundation import FactoryKit import CryptoKit import Combine import OSLog import Network import CacheKit import Security public struct DriveFileMetadata: Codable, Sendable { public let id: String public let name: String? public let modifiedTime: String? public let size: String? public let md5Checksum: String? public let parents: [String]? } public struct DriveChannel: Codable, Sendable { public let id: String? public let type: String? public let address: String? public let token: String? public let expiration: String? public let resourceId: String? public let resourceUri: String? } 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() } private static func relocateLocalMirrorFile( fileId: String, originalName: String?, targetStandardName: String, accountEmail: String, metadata: DriveFileMetadata ) async throws { fatalError() } private static func resolveCandidateFilePath( fileId: String, originalName: String?, targetStandardName: String, baseMirrorPath: String, fileManager: FileManager, metadata: DriveFileMetadata ) throws -> String { fatalError() } } @MainActor public class DriveAuthManager: ObservableObject { public static let shared = DriveAuthManager() public let clientID = "" public let reversedClientID = "" public let redirectURI = "" public let oauthPort: UInt16 = 0 @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() = DriveSyncEngine() @Published public var tunnelStatus: String = "" @Published public var isEngineRunning: Bool = false @Published public var filterActiveOnly: Bool = false @Published public var activeChatIDs: Set = [] 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 = "" 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() } } @Published public var monitoredFiles: [String: MonitoredFile] = [:] 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() = 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() } }