// ABI Hash: 38fd07842a60e3c176243004e69232e18c4a8aae455f17c0c77cd71ee526fa34 import Foundation import StreamlineFoundation import Synchronization import CacheKit import OSLog import AppKit import Observation public struct FactoryComms { public static let agentDidBecomeActive = Notification.Name("") public static let requestIntegrityCheck = Notification.Name("") public static let integrityCheckComplete = Notification.Name("") public static let hotelSyncDidComplete = Notification.Name("") public static let requestQuotaStatus = Notification.Name("") public static let quotaStatusReport = Notification.Name("") public static let requestBlankReplenishment = Notification.Name("") public static let blankReplenishmentComplete = Notification.Name("") public static let registryDidUpdate = Notification.Name("") public static let cacheImageRequest = Notification.Name("") } public extension NotificationCenter { static func postDistributed(_ name: Notification.Name, object: String? = nil, userInfo: [AnyHashable: Any]? = nil) { fatalError() } static func addDistributedObserver(_ observer: Any, selector: Selector, name: Notification.Name, object: String? = nil) { fatalError() } @discardableResult static func addDistributedObserver(forName name: Notification.Name, object: String? = nil, queue: OperationQueue? = nil, using block: @escaping @Sendable (Notification) -> Void) -> NSObjectProtocol { fatalError() } static func removeDistributedObserver(_ observer: Any) { fatalError() } static func removeDistributedObserver(_ observer: Any, name: Notification.Name?, object: String? = nil) { fatalError() } } /// A centralized source of truth for Factory file system locations. public struct FactoryPaths { /// The root of the Factory ecosystem ($FACTORY_HOME). public static var root: URL { get { fatalError() } } public static var externalStorage: URL { get { fatalError() } } public static var apps: URL { get { fatalError() } } public static var frameworks: URL { get { fatalError() } } public static var comms: URL { get { fatalError() } } public static var imageCache: URL { get { fatalError() } } public static var chatBackups: URL { get { fatalError() } } /// Generates a safe, isolated URL for a SwiftData/CoreData SQLite store, ensuring the parent directory exists. public static func databaseURL(for appName: String, storeName: String) -> URL { fatalError() } } public struct FactoryAuxiliaryWatch: Codable, Sendable { public var name: String = "" public var ownerApp: String = "" public var accountEmail: String = "" public var fileID: String = "" public var notifyChannel: String = "" public var enabled: Bool = false enum CodingKeys: String, CodingKey { case name case ownerApp = "owner_app" case accountEmail = "account_email" case fileID = "file_id" case notifyChannel = "notify_channel" case enabled } public init( name: String, ownerApp: String, accountEmail: String, fileID: String, notifyChannel: String, enabled: Bool = true ) { fatalError() } } public struct FactoryRegistry: Codable, Sendable { public var version: Int = 0 public var modified: Date? public var volumes: [String: FactoryVolume] = [:] public var accounts: [String: FactoryAccount] = [:] public var agents: [String: FactoryAgent] = [:] public var projects: [String: FactoryProject] = [:] public var workspaces: [String: FactoryWorkspace]? public var auxiliaryWatches: [String: FactoryAuxiliaryWatch]? public var verboseAgentReporting: [String: Bool]? enum CodingKeys: String, CodingKey { case version, modified, volumes, accounts, agents, projects, workspaces case auxiliaryWatches = "auxiliary_watches" case verboseAgentReporting = "verbose_agent_reporting" } public init( version: Int, volumes: [String: FactoryVolume], accounts: [String: FactoryAccount], agents: [String: FactoryAgent], projects: [String: FactoryProject], workspaces: [String: FactoryWorkspace]? = nil, auxiliaryWatches: [String: FactoryAuxiliaryWatch]? = nil, verboseAgentReporting: [String: Bool]? = nil, modified: Date? = nil ) { fatalError() } } public struct FactoryWorkspaceComponent: Codable, Sendable { public var type: String = "" public var platforms: [String] = [] public init(type: String, platforms: [String]) { fatalError() } } public struct FactoryWorkspace: Codable, Sendable { public var workspacePath: String = "" public var root: Root = Root() public var components: [String: FactoryWorkspaceComponent]? public struct Root: Codable, Sendable { public var apps: [String] = [] public var frameworks: [String] = [] public init(apps: [String] = [], frameworks: [String] = []) { fatalError() } } enum CodingKeys: String, CodingKey { case workspacePath = "workspace_path" case root case components } public init(workspacePath: String, root: Root = Root(), components: [String: FactoryWorkspaceComponent]? = nil) { fatalError() } } public struct FactoryVolume: Codable, Sendable { public let smbURL: String = "" public let mountPath: String = "" enum CodingKeys: String, CodingKey { case smbURL = "smb_url" case mountPath = "mount_path" } public init(smbURL: String, mountPath: String) { fatalError() } } public struct FactoryAccount: Codable, Sendable { public let email: String = "" public let colorHex: String? public let volumeID: String? public let rootPath: String? public var uIndex: Int? public var chatImagesFolderID: String? enum CodingKeys: String, CodingKey { case email, colorHex, rootPath, uIndex case volumeID = "volume_id" case chatImagesFolderID = "chat_images_folder_id" } public init(email: String, colorHex: String? = nil, volumeID: String? = nil, rootPath: String? = nil, uIndex: Int? = nil, chatImagesFolderID: String? = nil) { fatalError() } } public struct FactoryProject: Codable, Identifiable, Sendable { public var id: String { fatalError() } public var name: String = "" public var storedProjectPath: String? public var workspacePath: String? public var workspaceUUID: String? public var schemeName: String? public var supportsAutoRelaunch: Bool? public var type: String? public var platforms: [String]? public var frameworks: [String]? public var description: String? public var projectPath: String { fatalError() } enum CodingKeys: String, CodingKey { case name case storedProjectPath = "project_path" case workspacePath = "workspace_path" case workspaceUUID = "workspace_uuid" case workspace case schemeName = "scheme_name" case supportsAutoRelaunch = "supports_auto_relaunch" case type, platforms, frameworks, description } public init( name: String, storedProjectPath: String? = nil, workspacePath: String? = nil, workspaceUUID: String? = nil, schemeName: String? = nil, supportsAutoRelaunch: Bool? = true, type: String? = "app", platforms: [String]? = ["macOS"], frameworks: [String]? = nil, description: String? = nil ) { fatalError() } public init(from decoder: Decoder) throws { fatalError() } public func encode(to encoder: Encoder) throws { fatalError() } } public struct FactoryAssignment: Codable, Sendable { public var capabilities: [String] = [] public init(capabilities: [String]) { fatalError() } } public struct FactoryAgent: Codable, Sendable { public var name: String = "" public var isVisible: Bool = false public var activeAccount: String? public var chatIDs: [String: String] = [:] public var projects: [String: FactoryAssignment] = [:] public var model: String? public var status: String? public var wormholeVersion: Int? enum CodingKeys: String, CodingKey { case name, isVisible, chatIDs, projects case activeAccount = "active_account" case model, status case wormholeVersion = "wormhole_version" } public init( name: String, isVisible: Bool = true, activeAccount: String? = nil, model: String? = "gemini-3.1-pro-preview", status: String? = "active", chatIDs: [String: String], projects: [String: FactoryAssignment], wormholeVersion: Int? = nil ) { fatalError() } } public struct FactoryRegistryManager: Sendable { public static let shared = FactoryRegistryManager() public func loadRegistry() throws -> FactoryRegistry { fatalError() } public func saveRegistry(_ registry: FactoryRegistry, bumpModified: Bool = true) throws { fatalError() } public func registerWorkspace(uuid: UUID, path: String) throws { fatalError() } public func registerApp(_ appName: String, inWorkspace uuid: UUID) throws { fatalError() } public func registerFramework(_ frameworkName: String, inWorkspace uuid: UUID) throws { fatalError() } /// Finds a project by name or stored project path. /// - Parameter nameOrPath: The project name or stored project path to search for. /// - Returns: A tuple containing the registry key and the project, or nil if not found. public func findProject(nameOrPath: String) throws -> (key: String, project: FactoryProject)? { fatalError() } /// Inserts or updates a project in the registry using the provided key. /// - Parameters: /// - key: The dictionary key to use for the project. /// - project: The project to insert or update. public func upsertProject(key: String, project: FactoryProject) throws { fatalError() } /// Returns the computed project path for a web project by name, if it exists and is a web type. /// - Parameter forName: The name of the project to look up. /// - Returns: The computed project path if the project exists and is of type "web", otherwise nil. public func webProjectPath(forName: String) throws -> String? { fatalError() } public func resolvedPath(for project: FactoryProject) -> String? { fatalError() } public func workspace(forProject projectName: String) throws -> FactoryWorkspace? { fatalError() } public func apps(inWorkspace uuidString: String) -> [FactoryProject] { fatalError() } public func frameworks(inWorkspace uuidString: String) -> [FactoryProject] { fatalError() } public func projectName(for projectID: String) -> String? { fatalError() } public func xcodeProjectPaths() -> [String] { fatalError() } /// Resolves the full name of an active agent from a base name. /// - Parameter baseName: The base name to search for (e.g., "Frank", "Mike"). /// - Returns: The full name of the first matching visible agent (e.g., "Frank 2.0"), or nil if no match is found. public func resolveActiveAgent(baseName: String) -> String? { fatalError() } /// Returns all auxiliary watches from the registry. /// - Returns: A dictionary mapping keys to auxiliary watches, or an empty dictionary if none exist. public func auxiliaryWatches() throws -> [String: FactoryAuxiliaryWatch] { fatalError() } /// Retrieves a single auxiliary watch by key. /// - Parameter key: The dictionary key for the auxiliary watch. /// - Returns: The auxiliary watch matching the key, or nil if not found or if no watches exist. public func auxiliaryWatch(key: String) throws -> FactoryAuxiliaryWatch? { fatalError() } /// Returns auxiliary watches belonging to a specific owner app (case-insensitive). /// - Parameter appName: The owner app name to filter by. /// - Returns: A dictionary of matching auxiliary watches. public func auxiliaryWatches(forOwnerApp appName: String) throws -> [String: FactoryAuxiliaryWatch] { fatalError() } /// Inserts or updates an auxiliary watch in the registry using the provided key. /// - Parameters: /// - key: The dictionary key to use for the auxiliary watch. /// - watch: The auxiliary watch to insert or update. public func upsertAuxiliaryWatch(key: String, watch: FactoryAuxiliaryWatch) throws { fatalError() } /// Deletes an auxiliary watch from the registry if it exists. /// - Parameter key: The dictionary key of the auxiliary watch to delete. public func deleteAuxiliaryWatch(key: String) throws { fatalError() } /// Sets the enabled state of an auxiliary watch. /// - Parameters: /// - key: The dictionary key of the auxiliary watch. /// - enabled: The new enabled state. public func setAuxiliaryWatchEnabled(key: String, enabled: Bool) throws { fatalError() } /// Returns whether verbose reporting mode is enabled for the Groovy Monkey agent. /// - Returns: True if explicitly enabled for "groovy_monkey", false otherwise (including if dictionary is nil or key is absent). public func getGroovyReportingMode() throws -> Bool { fatalError() } /// Sets the verbose reporting mode for the Groovy Monkey agent. /// - Parameter enabled: The new enabled state for verbose reporting. public func setGroovyReportingMode(enabled: Bool) throws { fatalError() } /// Returns the chat images folder ID for a given account email. /// - Parameter accountEmail: The email of the account to look up. /// - Returns: The chat images folder ID if set, otherwise nil. public func chatImagesFolderID(for accountEmail: String) throws -> String? { fatalError() } /// Sets the chat images folder ID for a given account email. /// - Parameters: /// - folderID: The folder ID to set. /// - accountEmail: The email of the account to update. public func setChatImagesFolderID(_ folderID: String, for accountEmail: String) throws { fatalError() } /// Returns the wormhole protocol version for a given agent UUID. /// - Parameter agentUUID: The UUID of the agent to look up. /// - Returns: The wormhole version (defaults to 1 if not set). public func wormholeVersion(for agentUUID: String) throws -> Int { fatalError() } /// Sets the wormhole protocol version for a given agent UUID. /// - Parameters: /// - version: The wormhole version to set. /// - agentUUID: The UUID of the agent to update. public func setWormholeVersion(_ version: Int, for agentUUID: String) throws { fatalError() } } public struct FactoryResolver: Sendable { public static let shared = FactoryResolver() = 0 private init() { fatalError() } private struct ChatModelProbe: Decoidable { let runSettings: RunSettings? = nil struct RunSettings: Decodable { let model: String? = "" } } private func driveRootSuffix(forAccountEmail email: String) -> String { fatalError() } private func loadCurrentRegistry() throws -> FactoryRegistry { fatalError() } private func standardLocalRootPath(forAccountEmail email: String) -> String { fatalError() } /// Resolves the physical root path for a specific Google Account, handling local vs mounted VM volumes. public func rootPath(forAccountEmail email: String) -> String { fatalError() } /// Resolves the exact physical file path for an Agent's JSON chat file on a specific account. public func jsonFilePath(forAgentName agentName: String, accountEmail: String) -> String { fatalError() } /// Looks up the Google Drive Chat ID for a specific Agent and Account. public func chatID(forAgentName agentName: String, accountEmail: String) -> String? { fatalError() } /// Reverse lookup: Finds the Agent Name associated with a specific Google Drive Chat ID. public func agentName(forChatID chatID: String) -> String? { fatalError() } /// Reverse lookup: Finds the Account Email associated with a specific Google Drive Chat ID. public func accountEmail(forChatID chatID: String) -> String? { fatalError() } /// Extracts the chat model identifier from raw JSON data. /// /// Decodes a minimal probe to avoid allocating the full conversation history. /// Trims whitespace/newlines from the model string and returns `nil` if empty. /// Optionally strips a leading `"models/"` prefix. /// /// - Parameters: /// - jsonData: The raw JSON data from a chat file. /// - strippingPrefix: If `true` (default), removes a leading `"models/"` prefix from the model string. /// - Returns: The model identifier string, or `nil` if decoding fails or the field is missing/empty. public func chatModel(fromChatJSONData jsonData: Data, strippingPrefix: Bool) -> String? { fatalError() } /// Extracts the chat model identifier from a file at the given path. /// /// Checks that a readable regular file exists, loads its contents using memory-mapped /// `Data` options (`.mappedIfSafe`), and delegates to the JSON data helper. /// Returns `nil` cleanly if the file is missing or unreadable. /// /// - Parameters: /// - filePath: The absolute path to the chat JSON file. /// - strippingPrefix: If `true` (default), removes a leading `"models/"` prefix from the model string. /// - Returns: The model identifier string, or `nil` if the file is missing, unreadable, or decoding fails. public func chatModel(atFilePath filePath: String, strippingPrefix: Bool) -> String? { fatalError() } /// Primary facade: Resolves the chat model for a specific agent and account. /// /// Resolves the physical chat path via `jsonFilePath(forAgentName:accountEmail:)`. /// If no file exists at that exact path, checks the same path with `".json"` appended /// as a fallback, then delegates to the file-path helper. /// /// - Parameters: /// - agentName: The name of the agent (e.g., "Sidecar"). /// - accountEmail: The Google account email. /// - strippingPrefix: If `true` (default), removes a leading `"models/"` prefix from the model string. /// - Returns: The model identifier string, or `nil` if no chat file is found or decoding fails. public func chatModel(forAgentName agentName: String, accountEmail: String, strippingPrefix: Bool) -> String? { fatalError() } } /// A utility for standardizing cross-app PDS handshake replies. public struct PDSRouter: Sendable { /// Sends a standardized reply notification for a PDS handshake. /// - Parameters: /// - notification: The incoming notification containing the request ID. /// - resultData: A dictionary of result data to include in the reply. public static func reply(to notification: Notification, with resultData: [String: Any]) { fatalError() } } public final class StubSynchronizer: Sendable { public static let shared = StubSynchronizer() = 0 private let logger = Logger( subsystem: "", category: "" ) = 0 private init() { fatalError() } public func syncStubs(for projectID: String) throws { fatalError() } } @MainActor @Observable public final class VirtualMachineMonitor { public static let shared = VirtualMachineMonitor() public var isMounted: Bool = false public func checkStatus() { fatalError() } public func launchVM() { fatalError() } public func mountVolume() { fatalError() } } import AppKit import Observation @MainActor @Observable public final class VolumeManager { public static let shared = VolumeManager() // VolumeName -> IsMounted public var mountStatus: [String: Bool] = [:] public var knownVolumes: [String: FactoryVolume] = [:] public func refreshKnownVolumes() { fatalError() } public func checkAllStatuses() { fatalError() } public func mount(volumeName: String) { fatalError() } public func isMounted(volumeName: String) -> Bool { fatalError() } }