From 0dd82e4ce3bbd187f0346ef5003159ce9bb7e82d Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Thu, 29 Oct 2026 17:52:28 +1100 Subject: [PATCH 1/4] chore: require macOS 15, move to grpc-swift v2 and bump dependencies grpc-swift v2 needs macOS 15. With it, the Swift code for the .proto files is generated at build time by grpc-swift-protobuf's build tool plugin, which builds protoc and both protoc plugins from the resolved packages. The generated files, `make proto`, and the protoc tooling in the flake (including the stale grpc-swift flake and its separate nixpkgs pin) are all gone. Also bumps SwiftProtobuf, Sparkle, Subprocess, URLRouting, SDWebImageSwiftUI, SDWebImageSVGCoder, and the SwiftLintPlugins and ViewInspector floors, and raises the appcast and cask minimum macOS to 15. --- .gitattributes | 2 - .swiftlint.yml | 3 - CONTRIBUTING.md | 1 - Coder-Desktop/.swiftformat | 1 - .../Coder-Desktop/UpdaterService.swift | 5 +- .../FileSyncDaemonTests.swift | 2 - .../VPNLib/FileSync/DaemonClient.swift | 17 + .../VPNLib/FileSync/FileSyncDaemon.swift | 68 +- .../VPNLib/FileSync/FileSyncManagement.swift | 118 +- .../VPNLib/FileSync/FileSyncPrompting.swift | 107 +- .../filesystem_behavior_probe_mode.pb.swift | 109 - .../grpc-swift-proto-generator-config.json | 10 + .../MutagenSDK/selection_selection.pb.swift | 119 - .../service_daemon_daemon.grpc.swift | 397 --- .../MutagenSDK/service_daemon_daemon.pb.swift | 208 -- .../service_prompting_prompting.grpc.swift | 421 --- .../service_prompting_prompting.pb.swift | 279 -- ...synchronization_synchronization.grpc.swift | 908 ------ ...e_synchronization_synchronization.pb.swift | 1006 ------- ...hronization_compression_algorithm.pb.swift | 113 - .../synchronization_configuration.pb.swift | 433 --- .../synchronization_core_change.pb.swift | 140 - .../synchronization_core_conflict.pb.swift | 123 - .../synchronization_core_entry.pb.swift | 245 -- ...ation_core_ignore_ignore_vcs_mode.pb.swift | 106 - ...ynchronization_core_ignore_syntax.pb.swift | 106 - .../synchronization_core_mode.pb.swift | 135 - ...hronization_core_permissions_mode.pb.swift | 110 - .../synchronization_core_problem.pb.swift | 109 - ...onization_core_symbolic_link_mode.pb.swift | 118 - ...synchronization_hashing_algorithm.pb.swift | 111 - .../synchronization_rsync_receive.pb.swift | 145 - .../synchronization_scan_mode.pb.swift | 106 - .../synchronization_session.pb.swift | 370 --- .../synchronization_stage_mode.pb.swift | 115 - .../MutagenSDK/synchronization_state.pb.swift | 579 ---- .../synchronization_version.pb.swift | 98 - .../synchronization_watch_mode.pb.swift | 118 - .../FileSync/MutagenSDK/url_url.pb.swift | 266 -- .../grpc-swift-proto-generator-config.json | 10 + Coder-Desktop/VPNLib/vpn.pb.swift | 2545 ----------------- Coder-Desktop/project.yml | 63 +- Makefile | 19 +- flake.lock | 82 +- flake.nix | 19 - scripts/update-appcast/Sources/main.swift | 2 +- scripts/update-cask.sh | 2 +- 47 files changed, 249 insertions(+), 9920 deletions(-) create mode 100644 Coder-Desktop/VPNLib/FileSync/DaemonClient.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/filesystem_behavior_probe_mode.pb.swift create mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/grpc-swift-proto-generator-config.json delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/selection_selection.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.grpc.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.grpc.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.grpc.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_compression_algorithm.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_configuration.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_change.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_conflict.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_entry.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_ignore_vcs_mode.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_syntax.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_mode.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_permissions_mode.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_problem.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_symbolic_link_mode.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_hashing_algorithm.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_rsync_receive.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_scan_mode.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_session.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_stage_mode.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_state.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_version.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_watch_mode.pb.swift delete mode 100644 Coder-Desktop/VPNLib/FileSync/MutagenSDK/url_url.pb.swift create mode 100644 Coder-Desktop/VPNLib/grpc-swift-proto-generator-config.json delete mode 100644 Coder-Desktop/VPNLib/vpn.pb.swift diff --git a/.gitattributes b/.gitattributes index a0561475..a29cb0f0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1 @@ -**/*.pb.swift linguist-generated=true -**/*.grpc.swift linguist-generated=true Coder-Desktop/VPNLib/FileSync/MutagenSDK/*.proto linguist-generated=true diff --git a/.swiftlint.yml b/.swiftlint.yml index 1b167b77..47212a1e 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,5 +1,2 @@ -# TODO: Remove this once the grpc-swift-protobuf generator adds a lint disable comment excluded: - - "**/*.pb.swift" - - "**/*.grpc.swift" - "**/.build/" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a64d63cd..634e85af 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,7 +93,6 @@ Here are some useful `make` commands for working with the project: - `make lint`: Lint Swift files using SwiftLint. - `make test`: Run all tests using `xcodebuild`. - `make clean`: Clean the Xcode project. -- `make proto`: Generate Swift files from protobufs. - `make help`: Display all available `make` commands with descriptions. For continuous development, you can also use: diff --git a/Coder-Desktop/.swiftformat b/Coder-Desktop/.swiftformat index aeb673e1..23a896a9 100644 --- a/Coder-Desktop/.swiftformat +++ b/Coder-Desktop/.swiftformat @@ -1,4 +1,3 @@ --selfrequired log,info,error,debug,critical,fault ---exclude **.pb.swift,**.grpc.swift --condassignment always --disable unusedArguments,wrapIfStatementBodies,wrapPropertyBodies \ No newline at end of file diff --git a/Coder-Desktop/Coder-Desktop/UpdaterService.swift b/Coder-Desktop/Coder-Desktop/UpdaterService.swift index 78fc2ad5..bf23c0ee 100644 --- a/Coder-Desktop/Coder-Desktop/UpdaterService.swift +++ b/Coder-Desktop/Coder-Desktop/UpdaterService.swift @@ -1,6 +1,7 @@ import Sparkle import SwiftUI +@MainActor final class UpdaterService: NSObject, ObservableObject { /// The auto-updater can be entirely disabled by setting the /// `disableUpdater` UserDefaults key to `true`. This is designed for use in @@ -87,7 +88,7 @@ extension UpdaterService: SPUUpdaterDelegate { } extension UpdaterService: SUVersionDisplay { - func formatUpdateVersion( + nonisolated func formatUpdateVersion( fromUpdate update: SUAppcastItem, andBundleDisplayVersion inOutBundleDisplayVersion: AutoreleasingUnsafeMutablePointer, withBundleVersion bundleVersion: String @@ -102,7 +103,7 @@ extension UpdaterService: SUVersionDisplay { } extension UpdaterService: SPUStandardUserDriverDelegate { - func standardUserDriverRequestsVersionDisplayer() -> (any SUVersionDisplay)? { + nonisolated func standardUserDriverRequestsVersionDisplayer() -> (any SUVersionDisplay)? { self } } diff --git a/Coder-Desktop/Coder-DesktopTests/FileSyncDaemonTests.swift b/Coder-Desktop/Coder-DesktopTests/FileSyncDaemonTests.swift index 39f10ee1..eb35a32e 100644 --- a/Coder-Desktop/Coder-DesktopTests/FileSyncDaemonTests.swift +++ b/Coder-Desktop/Coder-DesktopTests/FileSyncDaemonTests.swift @@ -1,7 +1,5 @@ @testable import Coder_Desktop import Foundation -import GRPC -import NIO import Subprocess import Testing import VPNLib diff --git a/Coder-Desktop/VPNLib/FileSync/DaemonClient.swift b/Coder-Desktop/VPNLib/FileSync/DaemonClient.swift new file mode 100644 index 00000000..ddbf05b0 --- /dev/null +++ b/Coder-Desktop/VPNLib/FileSync/DaemonClient.swift @@ -0,0 +1,17 @@ +import GRPCCore +import GRPCNIOTransportHTTP2Posix + +struct DaemonClient { + let mgmt: Daemon_Daemon.Client + let sync: Synchronization_Synchronization.Client + let prompt: Prompting_Prompting.Client +} + +extension CallOptions { + static func timeout(_ timeout: Duration, waitForReady: Bool? = nil) -> Self { + var options = Self.defaults + options.timeout = timeout + options.waitForReady = waitForReady + return options + } +} diff --git a/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift b/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift index afaf5c58..c134506f 100644 --- a/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift +++ b/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift @@ -1,6 +1,6 @@ import Foundation -import GRPC -import NIO +import GRPCCore +import GRPCNIOTransportHTTP2Posix import os import Semaphore import Subprocess @@ -35,7 +35,7 @@ public class MutagenDaemon: FileSyncDaemon { logger.info("mutagen daemon state set: \(self.state.description, privacy: .public)") if case .failed = state { Task { - try? await cleanupGRPC() + await cleanupGRPC() } mutagenProcess?.kill() mutagenProcess = nil @@ -53,12 +53,12 @@ public class MutagenDaemon: FileSyncDaemon { public let logFile: URL /// Managing sync sessions could take a while, especially with prompting - let sessionMgmtReqTimeout: TimeAmount = .seconds(15) + let sessionMgmtReqTimeout: Duration = .seconds(15) // Non-nil when the daemon is running var client: DaemonClient? - private var group: MultiThreadedEventLoopGroup? - private var channel: GRPCChannel? + private var grpcClient: GRPCClient? + private var grpcConnections: Task? private var waitForExit: (@Sendable () async -> Void)? /// Protect start & stop transitions against re-entrancy @@ -160,7 +160,9 @@ public class MutagenDaemon: FileSyncDaemon { do { _ = try await self.client!.mgmt.version( Daemon_VersionRequest(), - callOptions: .init(timeLimit: .timeout(.milliseconds(500))) + // The socket might not exist yet, so wait for the + // connection instead of failing straight away. + options: .timeout(.milliseconds(500), waitForReady: true) ) return } catch { @@ -181,35 +183,45 @@ public class MutagenDaemon: FileSyncDaemon { // Already connected return } - group = MultiThreadedEventLoopGroup(numberOfThreads: 2) do { - channel = try GRPCChannelPool.with( - target: .unixDomainSocket(mutagenDaemonSocket.path), - transportSecurity: .plaintext, - eventLoopGroup: group! - ) + let grpcClient = try GRPCClient(transport: HTTP2ClientTransport.Posix( + target: .unixDomainSocket(path: mutagenDaemonSocket.path), + transportSecurity: .plaintext + )) + let logger = logger + grpcConnections = Task.detached { + do { + try await grpcClient.runConnections() + } catch { + logger.error("gRPC client stopped: \(error)") + } + } + self.grpcClient = grpcClient client = DaemonClient( - mgmt: Daemon_DaemonAsyncClient(channel: channel!), - sync: Synchronization_SynchronizationAsyncClient(channel: channel!), - prompt: Prompting_PromptingAsyncClient(channel: channel!) + mgmt: .init(wrapping: grpcClient), + sync: .init(wrapping: grpcClient), + prompt: .init(wrapping: grpcClient) ) logger.info( "Successfully connected to mutagen daemon, socket: \(self.mutagenDaemonSocket.path, privacy: .public)" ) } catch { logger.error("Failed to connect to gRPC: \(error)") - try? await cleanupGRPC() + await cleanupGRPC() throw .connectionFailure(error) } } - private func cleanupGRPC() async throws { - try? await channel?.close().get() - try? await group?.shutdownGracefully() - + private func cleanupGRPC() async { + let grpcClient = grpcClient + let grpcConnections = grpcConnections client = nil - channel = nil - group = nil + self.grpcClient = nil + self.grpcConnections = nil + + // Waits for any in-flight RPCs to finish + grpcClient?.beginGracefulShutdown() + await grpcConnections?.value } public func stop() async { @@ -228,10 +240,10 @@ public class MutagenDaemon: FileSyncDaemon { // may terminate before it has a chance to send the response." _ = try? await client?.mgmt.terminate( Daemon_TerminateRequest(), - callOptions: .init(timeLimit: .timeout(.milliseconds(500))) + options: .timeout(.milliseconds(500)) ) - try? await cleanupGRPC() + await cleanupGRPC() mutagenProcess?.kill() mutagenProcess = nil @@ -296,12 +308,6 @@ public class MutagenDaemon: FileSyncDaemon { } } -struct DaemonClient { - let mgmt: Daemon_DaemonAsyncClient - let sync: Synchronization_SynchronizationAsyncClient - let prompt: Prompting_PromptingAsyncClient -} - public enum DaemonState { case running case stopped diff --git a/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift b/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift index 3ae85b87..a00d4b3a 100644 --- a/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift +++ b/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift @@ -1,5 +1,3 @@ -import NIOCore - public extension MutagenDaemon { func refreshSessions() async { guard case .running = state else { return } @@ -29,27 +27,27 @@ public extension MutagenDaemon { throw error } } - let (stream, promptID) = try await host(promptCallback: promptCallback) - defer { stream.cancel() } - let req = Synchronization_CreateRequest.with { req in - req.prompter = promptID - req.specification = .with { spec in - spec.alpha = arg.alpha.mutagenURL - spec.beta = arg.beta.mutagenURL - // TODO: Ingest configs from somewhere - spec.configuration = .with { - // ALWAYS ignore VCS directories for now - // https://mutagen.io/documentation/synchronization/version-control-systems/ - $0.ignoreVcsmode = .ignore + try await withPrompter(promptCallback: promptCallback) { promptID throws(DaemonError) in + let req = Synchronization_CreateRequest.with { req in + req.prompter = promptID + req.specification = .with { spec in + spec.alpha = arg.alpha.mutagenURL + spec.beta = arg.beta.mutagenURL + // TODO: Ingest configs from somewhere + spec.configuration = .with { + // ALWAYS ignore VCS directories for now + // https://mutagen.io/documentation/synchronization/version-control-systems/ + $0.ignoreVcsmode = .ignore + } + spec.configurationAlpha = Synchronization_Configuration() + spec.configurationBeta = Synchronization_Configuration() } - spec.configurationAlpha = Synchronization_Configuration() - spec.configurationBeta = Synchronization_Configuration() } - } - do { - _ = try await client!.sync.create(req, callOptions: .init(timeLimit: .timeout(sessionMgmtReqTimeout * 4))) - } catch { - throw .grpcFailure(error) + do { + _ = try await client!.sync.create(req, options: .timeout(sessionMgmtReqTimeout * 4)) + } catch { + throw .grpcFailure(error) + } } await refreshSessions() } @@ -57,9 +55,7 @@ public extension MutagenDaemon { func deleteSessions(ids: [String]) async throws(DaemonError) { // Terminating sessions does not require prompting, according to the // Mutagen CLI - do { - let (stream, promptID) = try await host(allowPrompts: false) - defer { stream.cancel() } + try await withPrompter(allowPrompts: false) { promptID throws(DaemonError) in guard case .running = state else { return } do { _ = try await client!.sync.terminate(Synchronization_TerminateRequest.with { req in @@ -67,7 +63,7 @@ public extension MutagenDaemon { req.selection = .with { selection in selection.specifications = ids } - }, callOptions: .init(timeLimit: .timeout(sessionMgmtReqTimeout))) + }, options: .timeout(sessionMgmtReqTimeout)) } catch { throw .grpcFailure(error) } @@ -82,54 +78,54 @@ public extension MutagenDaemon { func pauseSessions(ids: [String]) async throws(DaemonError) { // Pausing sessions does not require prompting, according to the // Mutagen CLI - let (stream, promptID) = try await host(allowPrompts: false) - defer { stream.cancel() } - guard case .running = state else { return } - do { - _ = try await client!.sync.pause(Synchronization_PauseRequest.with { req in - req.prompter = promptID - req.selection = .with { selection in - selection.specifications = ids - } - }, callOptions: .init(timeLimit: .timeout(sessionMgmtReqTimeout))) - } catch { - throw .grpcFailure(error) + try await withPrompter(allowPrompts: false) { promptID throws(DaemonError) in + guard case .running = state else { return } + do { + _ = try await client!.sync.pause(Synchronization_PauseRequest.with { req in + req.prompter = promptID + req.selection = .with { selection in + selection.specifications = ids + } + }, options: .timeout(sessionMgmtReqTimeout)) + } catch { + throw .grpcFailure(error) + } } await refreshSessions() } func resumeSessions(ids: [String]) async throws(DaemonError) { // Resuming sessions does use prompting, as it may start a new SSH connection - let (stream, promptID) = try await host(allowPrompts: true) - defer { stream.cancel() } - guard case .running = state else { return } - do { - _ = try await client!.sync.resume(Synchronization_ResumeRequest.with { req in - req.prompter = promptID - req.selection = .with { selection in - selection.specifications = ids - } - }, callOptions: .init(timeLimit: .timeout(sessionMgmtReqTimeout))) - } catch { - throw .grpcFailure(error) + try await withPrompter(allowPrompts: true) { promptID throws(DaemonError) in + guard case .running = state else { return } + do { + _ = try await client!.sync.resume(Synchronization_ResumeRequest.with { req in + req.prompter = promptID + req.selection = .with { selection in + selection.specifications = ids + } + }, options: .timeout(sessionMgmtReqTimeout)) + } catch { + throw .grpcFailure(error) + } } await refreshSessions() } func resetSessions(ids: [String]) async throws(DaemonError) { // Resetting a session involves pausing & resuming, so it does use prompting - let (stream, promptID) = try await host(allowPrompts: true) - defer { stream.cancel() } - guard case .running = state else { return } - do { - _ = try await client!.sync.reset(Synchronization_ResetRequest.with { req in - req.prompter = promptID - req.selection = .with { selection in - selection.specifications = ids - } - }, callOptions: .init(timeLimit: .timeout(sessionMgmtReqTimeout))) - } catch { - throw .grpcFailure(error) + try await withPrompter(allowPrompts: true) { promptID throws(DaemonError) in + guard case .running = state else { return } + do { + _ = try await client!.sync.reset(Synchronization_ResetRequest.with { req in + req.prompter = promptID + req.selection = .with { selection in + selection.specifications = ids + } + }, options: .timeout(sessionMgmtReqTimeout)) + } catch { + throw .grpcFailure(error) + } } await refreshSessions() } diff --git a/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift b/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift index 7b8307a2..d6631149 100644 --- a/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift +++ b/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift @@ -1,58 +1,81 @@ -import GRPC +import GRPCCore extension MutagenDaemon { - typealias PromptStream = GRPCAsyncBidirectionalStreamingCall - - func host( + /// Hosts a prompter on the daemon for the duration of `body`, which is + /// passed the prompter identifier to include in requests that may prompt. + func withPrompter( allowPrompts: Bool = true, - promptCallback: (@MainActor (String) -> Void)? = nil - ) async throws(DaemonError) -> (PromptStream, identifier: String) { - let stream = client!.prompt.makeHostCall() + promptCallback: (@MainActor (String) -> Void)? = nil, + _ body: (_ promptID: String) async throws(DaemonError) -> T + ) async throws(DaemonError) -> T { + let (replies, replyContinuation) = AsyncStream.makeStream(of: Prompting_HostRequest.self) + let (identifier, identifierContinuation) = AsyncThrowingStream.makeStream(of: String.self) + let prompt = client!.prompt + let logger = logger - do { - try await stream.requestStream.send(.with { req in req.allowPrompts = allowPrompts }) - } catch { - throw .grpcFailure(error) + let hostTask = Task.detached(priority: .background) { + do { + try await prompt.host { writer in + try await writer.write(.with { req in req.allowPrompts = allowPrompts }) + for await reply in replies { + try await writer.write(reply) + } + } onResponse: { response in + var first = true + for try await msg in response.messages { + try msg.ensureValid(first: first, allowPrompts: allowPrompts) + if first { + first = false + identifierContinuation.yield(msg.identifier) + continue + } + replyContinuation.yield(reply(to: msg, promptCallback: promptCallback)) + } + } + identifierContinuation.finish() + } catch { + identifierContinuation.finish(throwing: error) + // The stream is cancelled once `body` returns + if !Task.isCancelled { + logger.critical("Prompt stream failed: \(error)") + } + } + } + defer { + replyContinuation.finish() + hostTask.cancel() } - // We can't make call `makeAsyncIterator` more than once - // (as a for-loop would do implicitly) - var iter = stream.responseStream.makeAsyncIterator() - - let initResp: Prompting_HostResponse? + let promptID: String? do { - initResp = try await iter.next() + var iter = identifier.makeAsyncIterator() + promptID = try await iter.next() + } catch let error as DaemonError { + throw error } catch { throw .grpcFailure(error) } - guard let initResp else { + guard let promptID else { throw .unexpectedStreamClosure } - try initResp.ensureValid(first: true, allowPrompts: allowPrompts) + return try await body(promptID) + } +} - Task.detached(priority: .background) { - do { - while let msg = try await iter.next() { - try msg.ensureValid(first: false, allowPrompts: allowPrompts) - var reply: Prompting_HostRequest = .init() - if msg.isPrompt { - // Handle SSH key prompts - if msg.message.contains("yes/no/[fingerprint]") { - reply.response = "yes" - } - // Any other messages that require a non-empty response will - // cause the create op to fail, showing an error. This is ok for now. - } else { - Task { @MainActor in promptCallback?(msg.message) } - } - try await stream.requestStream.send(reply) - } - } catch let error as GRPCStatus where error.code == .cancelled { - return - } catch { - self.logger.critical("Prompt stream failed: \(error)") - } +private func reply( + to msg: Prompting_HostResponse, + promptCallback: (@MainActor (String) -> Void)? +) -> Prompting_HostRequest { + var reply: Prompting_HostRequest = .init() + if msg.isPrompt { + // Handle SSH key prompts + if msg.message.contains("yes/no/[fingerprint]") { + reply.response = "yes" } - return (stream, identifier: initResp.identifier) + // Any other messages that require a non-empty response will + // cause the create op to fail, showing an error. This is ok for now. + } else { + Task { @MainActor in promptCallback?(msg.message) } } + return reply } diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/filesystem_behavior_probe_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/filesystem_behavior_probe_mode.pb.swift deleted file mode 100644 index 568903db..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/filesystem_behavior_probe_mode.pb.swift +++ /dev/null @@ -1,109 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: filesystem_behavior_probe_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/filesystem/behavior/probe_mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// ProbeMode specifies the mode for filesystem probing. -enum Behavior_ProbeMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// ProbeMode_ProbeModeDefault represents an unspecified probe mode. It - /// should be converted to one of the following values based on the desired - /// default behavior. - case `default` // = 0 - - /// ProbeMode_ProbeModeProbe specifies that filesystem behavior should be - /// determined using temporary files or, if possible, a "fast-path" mechanism - /// (such as filesystem format detection) that provides quick but certain - /// determination of filesystem behavior. - case probe // = 1 - - /// ProbeMode_ProbeModeAssume specifies that filesystem behavior should be - /// assumed based on the underlying platform. This is not as accurate as - /// ProbeMode_ProbeModeProbe. - case assume // = 2 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .probe - case 2: self = .assume - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .probe: return 1 - case .assume: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Behavior_ProbeMode] = [ - .default, - .probe, - .assume, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Behavior_ProbeMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ProbeModeDefault"), - 1: .same(proto: "ProbeModeProbe"), - 2: .same(proto: "ProbeModeAssume"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/grpc-swift-proto-generator-config.json b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/grpc-swift-proto-generator-config.json new file mode 100644 index 00000000..e66a467c --- /dev/null +++ b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/grpc-swift-proto-generator-config.json @@ -0,0 +1,10 @@ +{ + "generate": { + "clients": true, + "servers": false, + "messages": true + }, + "generatedSource": { + "accessLevel": "internal" + } +} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/selection_selection.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/selection_selection.pb.swift deleted file mode 100644 index c61b035c..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/selection_selection.pb.swift +++ /dev/null @@ -1,119 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: selection_selection.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/selection/selection.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Selection encodes a selection mechanism that can be used to select a -/// collection of sessions. It should have exactly one member set. -struct Selection_Selection: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// All, if true, indicates that all sessions should be selected. - var all: Bool = false - - /// Specifications is a list of session specifications. Each element may be - /// either a session identifier or name (or a prefix thereof). If non-empty, - /// it indicates that these specifications should be used to select sessions. - var specifications: [String] = [] - - /// LabelSelector is a label selector specification. If present (non-empty), - /// it indicates that this selector should be used to select sessions. - var labelSelector: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "selection" - -extension Selection_Selection: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Selection" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "all"), - 2: .same(proto: "specifications"), - 3: .same(proto: "labelSelector"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.all) }() - case 2: try { try decoder.decodeRepeatedStringField(value: &self.specifications) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.labelSelector) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.all != false { - try visitor.visitSingularBoolField(value: self.all, fieldNumber: 1) - } - if !self.specifications.isEmpty { - try visitor.visitRepeatedStringField(value: self.specifications, fieldNumber: 2) - } - if !self.labelSelector.isEmpty { - try visitor.visitSingularStringField(value: self.labelSelector, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Selection_Selection, rhs: Selection_Selection) -> Bool { - if lhs.all != rhs.all {return false} - if lhs.specifications != rhs.specifications {return false} - if lhs.labelSelector != rhs.labelSelector {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.grpc.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.grpc.swift deleted file mode 100644 index 809b5c2e..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.grpc.swift +++ /dev/null @@ -1,397 +0,0 @@ -// -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the protocol buffer compiler. -// Source: service_daemon_daemon.proto -// -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -/// Usage: instantiate `Daemon_DaemonClient`, then call methods of this protocol to make API calls. -internal protocol Daemon_DaemonClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? { get } - - func version( - _ request: Daemon_VersionRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func terminate( - _ request: Daemon_TerminateRequest, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Daemon_DaemonClientProtocol { - internal var serviceName: String { - return "daemon.Daemon" - } - - /// Unary call to Version - /// - /// - Parameters: - /// - request: Request to send to Version. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func version( - _ request: Daemon_VersionRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Daemon_DaemonClientMetadata.Methods.version.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeVersionInterceptors() ?? [] - ) - } - - /// Unary call to Terminate - /// - /// - Parameters: - /// - request: Request to send to Terminate. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func terminate( - _ request: Daemon_TerminateRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Daemon_DaemonClientMetadata.Methods.terminate.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Daemon_DaemonClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Daemon_DaemonNIOClient") -internal final class Daemon_DaemonClient: Daemon_DaemonClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - internal var interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the daemon.Daemon service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -internal struct Daemon_DaemonNIOClient: Daemon_DaemonClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? - - /// Creates a client for the daemon.Daemon service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Daemon_DaemonAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? { get } - - func makeVersionCall( - _ request: Daemon_VersionRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeTerminateCall( - _ request: Daemon_TerminateRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Daemon_DaemonAsyncClientProtocol { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Daemon_DaemonClientMetadata.serviceDescriptor - } - - internal var interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? { - return nil - } - - internal func makeVersionCall( - _ request: Daemon_VersionRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Daemon_DaemonClientMetadata.Methods.version.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeVersionInterceptors() ?? [] - ) - } - - internal func makeTerminateCall( - _ request: Daemon_TerminateRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Daemon_DaemonClientMetadata.Methods.terminate.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Daemon_DaemonAsyncClientProtocol { - internal func version( - _ request: Daemon_VersionRequest, - callOptions: CallOptions? = nil - ) async throws -> Daemon_VersionResponse { - return try await self.performAsyncUnaryCall( - path: Daemon_DaemonClientMetadata.Methods.version.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeVersionInterceptors() ?? [] - ) - } - - internal func terminate( - _ request: Daemon_TerminateRequest, - callOptions: CallOptions? = nil - ) async throws -> Daemon_TerminateResponse { - return try await self.performAsyncUnaryCall( - path: Daemon_DaemonClientMetadata.Methods.terminate.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal struct Daemon_DaemonAsyncClient: Daemon_DaemonAsyncClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? - - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Daemon_DaemonClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -internal protocol Daemon_DaemonClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'version'. - func makeVersionInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'terminate'. - func makeTerminateInterceptors() -> [ClientInterceptor] -} - -internal enum Daemon_DaemonClientMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "Daemon", - fullName: "daemon.Daemon", - methods: [ - Daemon_DaemonClientMetadata.Methods.version, - Daemon_DaemonClientMetadata.Methods.terminate, - ] - ) - - internal enum Methods { - internal static let version = GRPCMethodDescriptor( - name: "Version", - path: "/daemon.Daemon/Version", - type: GRPCCallType.unary - ) - - internal static let terminate = GRPCMethodDescriptor( - name: "Terminate", - path: "/daemon.Daemon/Terminate", - type: GRPCCallType.unary - ) - } -} - -/// To build a server, implement a class that conforms to this protocol. -internal protocol Daemon_DaemonProvider: CallHandlerProvider { - var interceptors: Daemon_DaemonServerInterceptorFactoryProtocol? { get } - - func version(request: Daemon_VersionRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - func terminate(request: Daemon_TerminateRequest, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Daemon_DaemonProvider { - internal var serviceName: Substring { - return Daemon_DaemonServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "Version": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeVersionInterceptors() ?? [], - userFunction: self.version(request:context:) - ) - - case "Terminate": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [], - userFunction: self.terminate(request:context:) - ) - - default: - return nil - } - } -} - -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Daemon_DaemonAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Daemon_DaemonServerInterceptorFactoryProtocol? { get } - - func version( - request: Daemon_VersionRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Daemon_VersionResponse - - func terminate( - request: Daemon_TerminateRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Daemon_TerminateResponse -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Daemon_DaemonAsyncProvider { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Daemon_DaemonServerMetadata.serviceDescriptor - } - - internal var serviceName: Substring { - return Daemon_DaemonServerMetadata.serviceDescriptor.fullName[...] - } - - internal var interceptors: Daemon_DaemonServerInterceptorFactoryProtocol? { - return nil - } - - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "Version": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeVersionInterceptors() ?? [], - wrapping: { try await self.version(request: $0, context: $1) } - ) - - case "Terminate": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [], - wrapping: { try await self.terminate(request: $0, context: $1) } - ) - - default: - return nil - } - } -} - -internal protocol Daemon_DaemonServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'version'. - /// Defaults to calling `self.makeInterceptors()`. - func makeVersionInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'terminate'. - /// Defaults to calling `self.makeInterceptors()`. - func makeTerminateInterceptors() -> [ServerInterceptor] -} - -internal enum Daemon_DaemonServerMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "Daemon", - fullName: "daemon.Daemon", - methods: [ - Daemon_DaemonServerMetadata.Methods.version, - Daemon_DaemonServerMetadata.Methods.terminate, - ] - ) - - internal enum Methods { - internal static let version = GRPCMethodDescriptor( - name: "Version", - path: "/daemon.Daemon/Version", - type: GRPCCallType.unary - ) - - internal static let terminate = GRPCMethodDescriptor( - name: "Terminate", - path: "/daemon.Daemon/Terminate", - type: GRPCCallType.unary - ) - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.pb.swift deleted file mode 100644 index ecd12a42..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.pb.swift +++ /dev/null @@ -1,208 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: service_daemon_daemon.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/service/daemon/daemon.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -struct Daemon_VersionRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Daemon_VersionResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// TODO: Should we encapsulate these inside a Version message type, perhaps - /// in the mutagen package? - var major: UInt64 = 0 - - var minor: UInt64 = 0 - - var patch: UInt64 = 0 - - var tag: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Daemon_TerminateRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -struct Daemon_TerminateResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "daemon" - -extension Daemon_VersionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".VersionRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Daemon_VersionRequest, rhs: Daemon_VersionRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Daemon_VersionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".VersionResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "major"), - 2: .same(proto: "minor"), - 3: .same(proto: "patch"), - 4: .same(proto: "tag"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.major) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.minor) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.patch) }() - case 4: try { try decoder.decodeSingularStringField(value: &self.tag) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.major != 0 { - try visitor.visitSingularUInt64Field(value: self.major, fieldNumber: 1) - } - if self.minor != 0 { - try visitor.visitSingularUInt64Field(value: self.minor, fieldNumber: 2) - } - if self.patch != 0 { - try visitor.visitSingularUInt64Field(value: self.patch, fieldNumber: 3) - } - if !self.tag.isEmpty { - try visitor.visitSingularStringField(value: self.tag, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Daemon_VersionResponse, rhs: Daemon_VersionResponse) -> Bool { - if lhs.major != rhs.major {return false} - if lhs.minor != rhs.minor {return false} - if lhs.patch != rhs.patch {return false} - if lhs.tag != rhs.tag {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Daemon_TerminateRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TerminateRequest" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Daemon_TerminateRequest, rhs: Daemon_TerminateRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Daemon_TerminateResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TerminateResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Daemon_TerminateResponse, rhs: Daemon_TerminateResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.grpc.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.grpc.swift deleted file mode 100644 index a79eb510..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.grpc.swift +++ /dev/null @@ -1,421 +0,0 @@ -// -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the protocol buffer compiler. -// Source: service_prompting_prompting.proto -// -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -/// Prompting allows clients to host and request prompting. -/// -/// Usage: instantiate `Prompting_PromptingClient`, then call methods of this protocol to make API calls. -internal protocol Prompting_PromptingClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? { get } - - func host( - callOptions: CallOptions?, - handler: @escaping (Prompting_HostResponse) -> Void - ) -> BidirectionalStreamingCall - - func prompt( - _ request: Prompting_PromptRequest, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Prompting_PromptingClientProtocol { - internal var serviceName: String { - return "prompting.Prompting" - } - - /// Host allows clients to perform prompt hosting. - /// - /// Callers should use the `send` method on the returned object to send messages - /// to the server. The caller should send an `.end` after the final message has been sent. - /// - /// - Parameters: - /// - callOptions: Call options. - /// - handler: A closure called when each response is received from the server. - /// - Returns: A `ClientStreamingCall` with futures for the metadata and status. - internal func host( - callOptions: CallOptions? = nil, - handler: @escaping (Prompting_HostResponse) -> Void - ) -> BidirectionalStreamingCall { - return self.makeBidirectionalStreamingCall( - path: Prompting_PromptingClientMetadata.Methods.host.path, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeHostInterceptors() ?? [], - handler: handler - ) - } - - /// Prompt performs prompting using a specific prompter. - /// - /// - Parameters: - /// - request: Request to send to Prompt. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func prompt( - _ request: Prompting_PromptRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Prompting_PromptingClientMetadata.Methods.prompt.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makePromptInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Prompting_PromptingClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Prompting_PromptingNIOClient") -internal final class Prompting_PromptingClient: Prompting_PromptingClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - internal var interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the prompting.Prompting service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -internal struct Prompting_PromptingNIOClient: Prompting_PromptingClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? - - /// Creates a client for the prompting.Prompting service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -/// Prompting allows clients to host and request prompting. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Prompting_PromptingAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? { get } - - func makeHostCall( - callOptions: CallOptions? - ) -> GRPCAsyncBidirectionalStreamingCall - - func makePromptCall( - _ request: Prompting_PromptRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Prompting_PromptingAsyncClientProtocol { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Prompting_PromptingClientMetadata.serviceDescriptor - } - - internal var interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? { - return nil - } - - internal func makeHostCall( - callOptions: CallOptions? = nil - ) -> GRPCAsyncBidirectionalStreamingCall { - return self.makeAsyncBidirectionalStreamingCall( - path: Prompting_PromptingClientMetadata.Methods.host.path, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeHostInterceptors() ?? [] - ) - } - - internal func makePromptCall( - _ request: Prompting_PromptRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Prompting_PromptingClientMetadata.Methods.prompt.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makePromptInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Prompting_PromptingAsyncClientProtocol { - internal func host( - _ requests: RequestStream, - callOptions: CallOptions? = nil - ) -> GRPCAsyncResponseStream where RequestStream: Sequence, RequestStream.Element == Prompting_HostRequest { - return self.performAsyncBidirectionalStreamingCall( - path: Prompting_PromptingClientMetadata.Methods.host.path, - requests: requests, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeHostInterceptors() ?? [] - ) - } - - internal func host( - _ requests: RequestStream, - callOptions: CallOptions? = nil - ) -> GRPCAsyncResponseStream where RequestStream: AsyncSequence & Sendable, RequestStream.Element == Prompting_HostRequest { - return self.performAsyncBidirectionalStreamingCall( - path: Prompting_PromptingClientMetadata.Methods.host.path, - requests: requests, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeHostInterceptors() ?? [] - ) - } - - internal func prompt( - _ request: Prompting_PromptRequest, - callOptions: CallOptions? = nil - ) async throws -> Prompting_PromptResponse { - return try await self.performAsyncUnaryCall( - path: Prompting_PromptingClientMetadata.Methods.prompt.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makePromptInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal struct Prompting_PromptingAsyncClient: Prompting_PromptingAsyncClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? - - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Prompting_PromptingClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -internal protocol Prompting_PromptingClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'host'. - func makeHostInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'prompt'. - func makePromptInterceptors() -> [ClientInterceptor] -} - -internal enum Prompting_PromptingClientMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "Prompting", - fullName: "prompting.Prompting", - methods: [ - Prompting_PromptingClientMetadata.Methods.host, - Prompting_PromptingClientMetadata.Methods.prompt, - ] - ) - - internal enum Methods { - internal static let host = GRPCMethodDescriptor( - name: "Host", - path: "/prompting.Prompting/Host", - type: GRPCCallType.bidirectionalStreaming - ) - - internal static let prompt = GRPCMethodDescriptor( - name: "Prompt", - path: "/prompting.Prompting/Prompt", - type: GRPCCallType.unary - ) - } -} - -/// Prompting allows clients to host and request prompting. -/// -/// To build a server, implement a class that conforms to this protocol. -internal protocol Prompting_PromptingProvider: CallHandlerProvider { - var interceptors: Prompting_PromptingServerInterceptorFactoryProtocol? { get } - - /// Host allows clients to perform prompt hosting. - func host(context: StreamingResponseCallContext) -> EventLoopFuture<(StreamEvent) -> Void> - - /// Prompt performs prompting using a specific prompter. - func prompt(request: Prompting_PromptRequest, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Prompting_PromptingProvider { - internal var serviceName: Substring { - return Prompting_PromptingServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "Host": - return BidirectionalStreamingServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeHostInterceptors() ?? [], - observerFactory: self.host(context:) - ) - - case "Prompt": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makePromptInterceptors() ?? [], - userFunction: self.prompt(request:context:) - ) - - default: - return nil - } - } -} - -/// Prompting allows clients to host and request prompting. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Prompting_PromptingAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Prompting_PromptingServerInterceptorFactoryProtocol? { get } - - /// Host allows clients to perform prompt hosting. - func host( - requestStream: GRPCAsyncRequestStream, - responseStream: GRPCAsyncResponseStreamWriter, - context: GRPCAsyncServerCallContext - ) async throws - - /// Prompt performs prompting using a specific prompter. - func prompt( - request: Prompting_PromptRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Prompting_PromptResponse -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Prompting_PromptingAsyncProvider { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Prompting_PromptingServerMetadata.serviceDescriptor - } - - internal var serviceName: Substring { - return Prompting_PromptingServerMetadata.serviceDescriptor.fullName[...] - } - - internal var interceptors: Prompting_PromptingServerInterceptorFactoryProtocol? { - return nil - } - - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "Host": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeHostInterceptors() ?? [], - wrapping: { try await self.host(requestStream: $0, responseStream: $1, context: $2) } - ) - - case "Prompt": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makePromptInterceptors() ?? [], - wrapping: { try await self.prompt(request: $0, context: $1) } - ) - - default: - return nil - } - } -} - -internal protocol Prompting_PromptingServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'host'. - /// Defaults to calling `self.makeInterceptors()`. - func makeHostInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'prompt'. - /// Defaults to calling `self.makeInterceptors()`. - func makePromptInterceptors() -> [ServerInterceptor] -} - -internal enum Prompting_PromptingServerMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "Prompting", - fullName: "prompting.Prompting", - methods: [ - Prompting_PromptingServerMetadata.Methods.host, - Prompting_PromptingServerMetadata.Methods.prompt, - ] - ) - - internal enum Methods { - internal static let host = GRPCMethodDescriptor( - name: "Host", - path: "/prompting.Prompting/Host", - type: GRPCCallType.bidirectionalStreaming - ) - - internal static let prompt = GRPCMethodDescriptor( - name: "Prompt", - path: "/prompting.Prompting/Prompt", - type: GRPCCallType.unary - ) - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.pb.swift deleted file mode 100644 index 3564336f..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.pb.swift +++ /dev/null @@ -1,279 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: service_prompting_prompting.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/service/prompting/prompting.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// HostRequest encodes either an initial request to perform prompt hosting or a -/// follow-up response to a message or prompt. -struct Prompting_HostRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// AllowPrompts indicates whether or not the hoster will allow prompts. If - /// not, it will only receive message requests. This field may only be set on - /// the initial request. - var allowPrompts: Bool = false - - /// Response is the prompt response, if any. On the initial request, this - /// must be an empty string. When responding to a prompt, it may be any - /// value. When responding to a message, it must be an empty string. - var response: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// HostResponse encodes either an initial response to perform prompt hosting or -/// a follow-up request for messaging or prompting. -struct Prompting_HostResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Identifier is the prompter identifier. It is only set in the initial - /// response sent after the initial request. - var identifier: String = String() - - /// IsPrompt indicates if the response is requesting a prompt (as opposed to - /// simple message display). - var isPrompt: Bool = false - - /// Message is the message associated with the prompt or message. - var message: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// PromptRequest encodes a request for prompting by a specific prompter. -struct Prompting_PromptRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Prompter is the prompter identifier. - var prompter: String = String() - - /// Prompt is the prompt to present. - var prompt: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// PromptResponse encodes the response from a prompter. -struct Prompting_PromptResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Response is the response returned by the prompter. - var response: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "prompting" - -extension Prompting_HostRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".HostRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "allowPrompts"), - 2: .same(proto: "response"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.allowPrompts) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.response) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.allowPrompts != false { - try visitor.visitSingularBoolField(value: self.allowPrompts, fieldNumber: 1) - } - if !self.response.isEmpty { - try visitor.visitSingularStringField(value: self.response, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Prompting_HostRequest, rhs: Prompting_HostRequest) -> Bool { - if lhs.allowPrompts != rhs.allowPrompts {return false} - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Prompting_HostResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".HostResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "identifier"), - 2: .same(proto: "isPrompt"), - 3: .same(proto: "message"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.identifier) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.isPrompt) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.message) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.identifier.isEmpty { - try visitor.visitSingularStringField(value: self.identifier, fieldNumber: 1) - } - if self.isPrompt != false { - try visitor.visitSingularBoolField(value: self.isPrompt, fieldNumber: 2) - } - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Prompting_HostResponse, rhs: Prompting_HostResponse) -> Bool { - if lhs.identifier != rhs.identifier {return false} - if lhs.isPrompt != rhs.isPrompt {return false} - if lhs.message != rhs.message {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Prompting_PromptRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".PromptRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prompter"), - 2: .same(proto: "prompt"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.prompter) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.prompt) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.prompter.isEmpty { - try visitor.visitSingularStringField(value: self.prompter, fieldNumber: 1) - } - if !self.prompt.isEmpty { - try visitor.visitSingularStringField(value: self.prompt, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Prompting_PromptRequest, rhs: Prompting_PromptRequest) -> Bool { - if lhs.prompter != rhs.prompter {return false} - if lhs.prompt != rhs.prompt {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Prompting_PromptResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".PromptResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "response"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.response) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.response.isEmpty { - try visitor.visitSingularStringField(value: self.response, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Prompting_PromptResponse, rhs: Prompting_PromptResponse) -> Bool { - if lhs.response != rhs.response {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.grpc.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.grpc.swift deleted file mode 100644 index aa8abe25..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.grpc.swift +++ /dev/null @@ -1,908 +0,0 @@ -// -// DO NOT EDIT. -// swift-format-ignore-file -// -// Generated by the protocol buffer compiler. -// Source: service_synchronization_synchronization.proto -// -import GRPC -import NIO -import NIOConcurrencyHelpers -import SwiftProtobuf - - -/// Synchronization manages the lifecycle of synchronization sessions. -/// -/// Usage: instantiate `Synchronization_SynchronizationClient`, then call methods of this protocol to make API calls. -internal protocol Synchronization_SynchronizationClientProtocol: GRPCClient { - var serviceName: String { get } - var interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? { get } - - func create( - _ request: Synchronization_CreateRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func list( - _ request: Synchronization_ListRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func flush( - _ request: Synchronization_FlushRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func pause( - _ request: Synchronization_PauseRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func resume( - _ request: Synchronization_ResumeRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func reset( - _ request: Synchronization_ResetRequest, - callOptions: CallOptions? - ) -> UnaryCall - - func terminate( - _ request: Synchronization_TerminateRequest, - callOptions: CallOptions? - ) -> UnaryCall -} - -extension Synchronization_SynchronizationClientProtocol { - internal var serviceName: String { - return "synchronization.Synchronization" - } - - /// Create creates a new session. - /// - /// - Parameters: - /// - request: Request to send to Create. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func create( - _ request: Synchronization_CreateRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.create.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeCreateInterceptors() ?? [] - ) - } - - /// List returns metadata for existing sessions. - /// - /// - Parameters: - /// - request: Request to send to List. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func list( - _ request: Synchronization_ListRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.list.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeListInterceptors() ?? [] - ) - } - - /// Flush flushes sessions. - /// - /// - Parameters: - /// - request: Request to send to Flush. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func flush( - _ request: Synchronization_FlushRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.flush.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeFlushInterceptors() ?? [] - ) - } - - /// Pause pauses sessions. - /// - /// - Parameters: - /// - request: Request to send to Pause. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func pause( - _ request: Synchronization_PauseRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.pause.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makePauseInterceptors() ?? [] - ) - } - - /// Resume resumes paused or disconnected sessions. - /// - /// - Parameters: - /// - request: Request to send to Resume. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func resume( - _ request: Synchronization_ResumeRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.resume.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeResumeInterceptors() ?? [] - ) - } - - /// Reset resets sessions' histories. - /// - /// - Parameters: - /// - request: Request to send to Reset. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func reset( - _ request: Synchronization_ResetRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.reset.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeResetInterceptors() ?? [] - ) - } - - /// Terminate terminates sessions. - /// - /// - Parameters: - /// - request: Request to send to Terminate. - /// - callOptions: Call options. - /// - Returns: A `UnaryCall` with futures for the metadata, status and response. - internal func terminate( - _ request: Synchronization_TerminateRequest, - callOptions: CallOptions? = nil - ) -> UnaryCall { - return self.makeUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.terminate.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [] - ) - } -} - -@available(*, deprecated) -extension Synchronization_SynchronizationClient: @unchecked Sendable {} - -@available(*, deprecated, renamed: "Synchronization_SynchronizationNIOClient") -internal final class Synchronization_SynchronizationClient: Synchronization_SynchronizationClientProtocol { - private let lock = Lock() - private var _defaultCallOptions: CallOptions - private var _interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? - internal let channel: GRPCChannel - internal var defaultCallOptions: CallOptions { - get { self.lock.withLock { return self._defaultCallOptions } } - set { self.lock.withLockVoid { self._defaultCallOptions = newValue } } - } - internal var interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? { - get { self.lock.withLock { return self._interceptors } } - set { self.lock.withLockVoid { self._interceptors = newValue } } - } - - /// Creates a client for the synchronization.Synchronization service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self._defaultCallOptions = defaultCallOptions - self._interceptors = interceptors - } -} - -internal struct Synchronization_SynchronizationNIOClient: Synchronization_SynchronizationClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? - - /// Creates a client for the synchronization.Synchronization service. - /// - /// - Parameters: - /// - channel: `GRPCChannel` to the service host. - /// - defaultCallOptions: Options to use for each service call if the user doesn't provide them. - /// - interceptors: A factory providing interceptors for each RPC. - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -/// Synchronization manages the lifecycle of synchronization sessions. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Synchronization_SynchronizationAsyncClientProtocol: GRPCClient { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? { get } - - func makeCreateCall( - _ request: Synchronization_CreateRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeListCall( - _ request: Synchronization_ListRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeFlushCall( - _ request: Synchronization_FlushRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makePauseCall( - _ request: Synchronization_PauseRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeResumeCall( - _ request: Synchronization_ResumeRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeResetCall( - _ request: Synchronization_ResetRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall - - func makeTerminateCall( - _ request: Synchronization_TerminateRequest, - callOptions: CallOptions? - ) -> GRPCAsyncUnaryCall -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Synchronization_SynchronizationAsyncClientProtocol { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Synchronization_SynchronizationClientMetadata.serviceDescriptor - } - - internal var interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? { - return nil - } - - internal func makeCreateCall( - _ request: Synchronization_CreateRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.create.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeCreateInterceptors() ?? [] - ) - } - - internal func makeListCall( - _ request: Synchronization_ListRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.list.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeListInterceptors() ?? [] - ) - } - - internal func makeFlushCall( - _ request: Synchronization_FlushRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.flush.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeFlushInterceptors() ?? [] - ) - } - - internal func makePauseCall( - _ request: Synchronization_PauseRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.pause.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makePauseInterceptors() ?? [] - ) - } - - internal func makeResumeCall( - _ request: Synchronization_ResumeRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.resume.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeResumeInterceptors() ?? [] - ) - } - - internal func makeResetCall( - _ request: Synchronization_ResetRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.reset.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeResetInterceptors() ?? [] - ) - } - - internal func makeTerminateCall( - _ request: Synchronization_TerminateRequest, - callOptions: CallOptions? = nil - ) -> GRPCAsyncUnaryCall { - return self.makeAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.terminate.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Synchronization_SynchronizationAsyncClientProtocol { - internal func create( - _ request: Synchronization_CreateRequest, - callOptions: CallOptions? = nil - ) async throws -> Synchronization_CreateResponse { - return try await self.performAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.create.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeCreateInterceptors() ?? [] - ) - } - - internal func list( - _ request: Synchronization_ListRequest, - callOptions: CallOptions? = nil - ) async throws -> Synchronization_ListResponse { - return try await self.performAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.list.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeListInterceptors() ?? [] - ) - } - - internal func flush( - _ request: Synchronization_FlushRequest, - callOptions: CallOptions? = nil - ) async throws -> Synchronization_FlushResponse { - return try await self.performAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.flush.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeFlushInterceptors() ?? [] - ) - } - - internal func pause( - _ request: Synchronization_PauseRequest, - callOptions: CallOptions? = nil - ) async throws -> Synchronization_PauseResponse { - return try await self.performAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.pause.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makePauseInterceptors() ?? [] - ) - } - - internal func resume( - _ request: Synchronization_ResumeRequest, - callOptions: CallOptions? = nil - ) async throws -> Synchronization_ResumeResponse { - return try await self.performAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.resume.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeResumeInterceptors() ?? [] - ) - } - - internal func reset( - _ request: Synchronization_ResetRequest, - callOptions: CallOptions? = nil - ) async throws -> Synchronization_ResetResponse { - return try await self.performAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.reset.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeResetInterceptors() ?? [] - ) - } - - internal func terminate( - _ request: Synchronization_TerminateRequest, - callOptions: CallOptions? = nil - ) async throws -> Synchronization_TerminateResponse { - return try await self.performAsyncUnaryCall( - path: Synchronization_SynchronizationClientMetadata.Methods.terminate.path, - request: request, - callOptions: callOptions ?? self.defaultCallOptions, - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [] - ) - } -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal struct Synchronization_SynchronizationAsyncClient: Synchronization_SynchronizationAsyncClientProtocol { - internal var channel: GRPCChannel - internal var defaultCallOptions: CallOptions - internal var interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? - - internal init( - channel: GRPCChannel, - defaultCallOptions: CallOptions = CallOptions(), - interceptors: Synchronization_SynchronizationClientInterceptorFactoryProtocol? = nil - ) { - self.channel = channel - self.defaultCallOptions = defaultCallOptions - self.interceptors = interceptors - } -} - -internal protocol Synchronization_SynchronizationClientInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when invoking 'create'. - func makeCreateInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'list'. - func makeListInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'flush'. - func makeFlushInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'pause'. - func makePauseInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'resume'. - func makeResumeInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'reset'. - func makeResetInterceptors() -> [ClientInterceptor] - - /// - Returns: Interceptors to use when invoking 'terminate'. - func makeTerminateInterceptors() -> [ClientInterceptor] -} - -internal enum Synchronization_SynchronizationClientMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "Synchronization", - fullName: "synchronization.Synchronization", - methods: [ - Synchronization_SynchronizationClientMetadata.Methods.create, - Synchronization_SynchronizationClientMetadata.Methods.list, - Synchronization_SynchronizationClientMetadata.Methods.flush, - Synchronization_SynchronizationClientMetadata.Methods.pause, - Synchronization_SynchronizationClientMetadata.Methods.resume, - Synchronization_SynchronizationClientMetadata.Methods.reset, - Synchronization_SynchronizationClientMetadata.Methods.terminate, - ] - ) - - internal enum Methods { - internal static let create = GRPCMethodDescriptor( - name: "Create", - path: "/synchronization.Synchronization/Create", - type: GRPCCallType.unary - ) - - internal static let list = GRPCMethodDescriptor( - name: "List", - path: "/synchronization.Synchronization/List", - type: GRPCCallType.unary - ) - - internal static let flush = GRPCMethodDescriptor( - name: "Flush", - path: "/synchronization.Synchronization/Flush", - type: GRPCCallType.unary - ) - - internal static let pause = GRPCMethodDescriptor( - name: "Pause", - path: "/synchronization.Synchronization/Pause", - type: GRPCCallType.unary - ) - - internal static let resume = GRPCMethodDescriptor( - name: "Resume", - path: "/synchronization.Synchronization/Resume", - type: GRPCCallType.unary - ) - - internal static let reset = GRPCMethodDescriptor( - name: "Reset", - path: "/synchronization.Synchronization/Reset", - type: GRPCCallType.unary - ) - - internal static let terminate = GRPCMethodDescriptor( - name: "Terminate", - path: "/synchronization.Synchronization/Terminate", - type: GRPCCallType.unary - ) - } -} - -/// Synchronization manages the lifecycle of synchronization sessions. -/// -/// To build a server, implement a class that conforms to this protocol. -internal protocol Synchronization_SynchronizationProvider: CallHandlerProvider { - var interceptors: Synchronization_SynchronizationServerInterceptorFactoryProtocol? { get } - - /// Create creates a new session. - func create(request: Synchronization_CreateRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// List returns metadata for existing sessions. - func list(request: Synchronization_ListRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Flush flushes sessions. - func flush(request: Synchronization_FlushRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Pause pauses sessions. - func pause(request: Synchronization_PauseRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Resume resumes paused or disconnected sessions. - func resume(request: Synchronization_ResumeRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Reset resets sessions' histories. - func reset(request: Synchronization_ResetRequest, context: StatusOnlyCallContext) -> EventLoopFuture - - /// Terminate terminates sessions. - func terminate(request: Synchronization_TerminateRequest, context: StatusOnlyCallContext) -> EventLoopFuture -} - -extension Synchronization_SynchronizationProvider { - internal var serviceName: Substring { - return Synchronization_SynchronizationServerMetadata.serviceDescriptor.fullName[...] - } - - /// Determines, calls and returns the appropriate request handler, depending on the request's method. - /// Returns nil for methods not handled by this service. - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "Create": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeCreateInterceptors() ?? [], - userFunction: self.create(request:context:) - ) - - case "List": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeListInterceptors() ?? [], - userFunction: self.list(request:context:) - ) - - case "Flush": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeFlushInterceptors() ?? [], - userFunction: self.flush(request:context:) - ) - - case "Pause": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makePauseInterceptors() ?? [], - userFunction: self.pause(request:context:) - ) - - case "Resume": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeResumeInterceptors() ?? [], - userFunction: self.resume(request:context:) - ) - - case "Reset": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeResetInterceptors() ?? [], - userFunction: self.reset(request:context:) - ) - - case "Terminate": - return UnaryServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [], - userFunction: self.terminate(request:context:) - ) - - default: - return nil - } - } -} - -/// Synchronization manages the lifecycle of synchronization sessions. -/// -/// To implement a server, implement an object which conforms to this protocol. -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -internal protocol Synchronization_SynchronizationAsyncProvider: CallHandlerProvider, Sendable { - static var serviceDescriptor: GRPCServiceDescriptor { get } - var interceptors: Synchronization_SynchronizationServerInterceptorFactoryProtocol? { get } - - /// Create creates a new session. - func create( - request: Synchronization_CreateRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Synchronization_CreateResponse - - /// List returns metadata for existing sessions. - func list( - request: Synchronization_ListRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Synchronization_ListResponse - - /// Flush flushes sessions. - func flush( - request: Synchronization_FlushRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Synchronization_FlushResponse - - /// Pause pauses sessions. - func pause( - request: Synchronization_PauseRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Synchronization_PauseResponse - - /// Resume resumes paused or disconnected sessions. - func resume( - request: Synchronization_ResumeRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Synchronization_ResumeResponse - - /// Reset resets sessions' histories. - func reset( - request: Synchronization_ResetRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Synchronization_ResetResponse - - /// Terminate terminates sessions. - func terminate( - request: Synchronization_TerminateRequest, - context: GRPCAsyncServerCallContext - ) async throws -> Synchronization_TerminateResponse -} - -@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) -extension Synchronization_SynchronizationAsyncProvider { - internal static var serviceDescriptor: GRPCServiceDescriptor { - return Synchronization_SynchronizationServerMetadata.serviceDescriptor - } - - internal var serviceName: Substring { - return Synchronization_SynchronizationServerMetadata.serviceDescriptor.fullName[...] - } - - internal var interceptors: Synchronization_SynchronizationServerInterceptorFactoryProtocol? { - return nil - } - - internal func handle( - method name: Substring, - context: CallHandlerContext - ) -> GRPCServerHandlerProtocol? { - switch name { - case "Create": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeCreateInterceptors() ?? [], - wrapping: { try await self.create(request: $0, context: $1) } - ) - - case "List": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeListInterceptors() ?? [], - wrapping: { try await self.list(request: $0, context: $1) } - ) - - case "Flush": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeFlushInterceptors() ?? [], - wrapping: { try await self.flush(request: $0, context: $1) } - ) - - case "Pause": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makePauseInterceptors() ?? [], - wrapping: { try await self.pause(request: $0, context: $1) } - ) - - case "Resume": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeResumeInterceptors() ?? [], - wrapping: { try await self.resume(request: $0, context: $1) } - ) - - case "Reset": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeResetInterceptors() ?? [], - wrapping: { try await self.reset(request: $0, context: $1) } - ) - - case "Terminate": - return GRPCAsyncServerHandler( - context: context, - requestDeserializer: ProtobufDeserializer(), - responseSerializer: ProtobufSerializer(), - interceptors: self.interceptors?.makeTerminateInterceptors() ?? [], - wrapping: { try await self.terminate(request: $0, context: $1) } - ) - - default: - return nil - } - } -} - -internal protocol Synchronization_SynchronizationServerInterceptorFactoryProtocol: Sendable { - - /// - Returns: Interceptors to use when handling 'create'. - /// Defaults to calling `self.makeInterceptors()`. - func makeCreateInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'list'. - /// Defaults to calling `self.makeInterceptors()`. - func makeListInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'flush'. - /// Defaults to calling `self.makeInterceptors()`. - func makeFlushInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'pause'. - /// Defaults to calling `self.makeInterceptors()`. - func makePauseInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'resume'. - /// Defaults to calling `self.makeInterceptors()`. - func makeResumeInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'reset'. - /// Defaults to calling `self.makeInterceptors()`. - func makeResetInterceptors() -> [ServerInterceptor] - - /// - Returns: Interceptors to use when handling 'terminate'. - /// Defaults to calling `self.makeInterceptors()`. - func makeTerminateInterceptors() -> [ServerInterceptor] -} - -internal enum Synchronization_SynchronizationServerMetadata { - internal static let serviceDescriptor = GRPCServiceDescriptor( - name: "Synchronization", - fullName: "synchronization.Synchronization", - methods: [ - Synchronization_SynchronizationServerMetadata.Methods.create, - Synchronization_SynchronizationServerMetadata.Methods.list, - Synchronization_SynchronizationServerMetadata.Methods.flush, - Synchronization_SynchronizationServerMetadata.Methods.pause, - Synchronization_SynchronizationServerMetadata.Methods.resume, - Synchronization_SynchronizationServerMetadata.Methods.reset, - Synchronization_SynchronizationServerMetadata.Methods.terminate, - ] - ) - - internal enum Methods { - internal static let create = GRPCMethodDescriptor( - name: "Create", - path: "/synchronization.Synchronization/Create", - type: GRPCCallType.unary - ) - - internal static let list = GRPCMethodDescriptor( - name: "List", - path: "/synchronization.Synchronization/List", - type: GRPCCallType.unary - ) - - internal static let flush = GRPCMethodDescriptor( - name: "Flush", - path: "/synchronization.Synchronization/Flush", - type: GRPCCallType.unary - ) - - internal static let pause = GRPCMethodDescriptor( - name: "Pause", - path: "/synchronization.Synchronization/Pause", - type: GRPCCallType.unary - ) - - internal static let resume = GRPCMethodDescriptor( - name: "Resume", - path: "/synchronization.Synchronization/Resume", - type: GRPCCallType.unary - ) - - internal static let reset = GRPCMethodDescriptor( - name: "Reset", - path: "/synchronization.Synchronization/Reset", - type: GRPCCallType.unary - ) - - internal static let terminate = GRPCMethodDescriptor( - name: "Terminate", - path: "/synchronization.Synchronization/Terminate", - type: GRPCCallType.unary - ) - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.pb.swift deleted file mode 100644 index f15a5cba..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.pb.swift +++ /dev/null @@ -1,1006 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: service_synchronization_synchronization.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/service/synchronization/synchronization.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// CreationSpecification contains the metadata required for a new session. -struct Synchronization_CreationSpecification: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Alpha is the alpha endpoint URL for the session. - var alpha: Url_URL { - get {return _storage._alpha ?? Url_URL()} - set {_uniqueStorage()._alpha = newValue} - } - /// Returns true if `alpha` has been explicitly set. - var hasAlpha: Bool {return _storage._alpha != nil} - /// Clears the value of `alpha`. Subsequent reads from it will return its default value. - mutating func clearAlpha() {_uniqueStorage()._alpha = nil} - - /// Beta is the beta endpoint URL for the session. - var beta: Url_URL { - get {return _storage._beta ?? Url_URL()} - set {_uniqueStorage()._beta = newValue} - } - /// Returns true if `beta` has been explicitly set. - var hasBeta: Bool {return _storage._beta != nil} - /// Clears the value of `beta`. Subsequent reads from it will return its default value. - mutating func clearBeta() {_uniqueStorage()._beta = nil} - - /// Configuration is the base session configuration. It is the result of - /// merging the global configuration (unless disabled), any manually - /// specified configuration file, and any command line configuration - /// parameters. - var configuration: Synchronization_Configuration { - get {return _storage._configuration ?? Synchronization_Configuration()} - set {_uniqueStorage()._configuration = newValue} - } - /// Returns true if `configuration` has been explicitly set. - var hasConfiguration: Bool {return _storage._configuration != nil} - /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} - - /// ConfigurationAlpha is the alpha-specific session configuration. It is - /// determined based on command line configuration parameters. - var configurationAlpha: Synchronization_Configuration { - get {return _storage._configurationAlpha ?? Synchronization_Configuration()} - set {_uniqueStorage()._configurationAlpha = newValue} - } - /// Returns true if `configurationAlpha` has been explicitly set. - var hasConfigurationAlpha: Bool {return _storage._configurationAlpha != nil} - /// Clears the value of `configurationAlpha`. Subsequent reads from it will return its default value. - mutating func clearConfigurationAlpha() {_uniqueStorage()._configurationAlpha = nil} - - /// ConfigurationBeta is the beta-specific session configuration. It is - /// determined based on command line configuration parameters. - var configurationBeta: Synchronization_Configuration { - get {return _storage._configurationBeta ?? Synchronization_Configuration()} - set {_uniqueStorage()._configurationBeta = newValue} - } - /// Returns true if `configurationBeta` has been explicitly set. - var hasConfigurationBeta: Bool {return _storage._configurationBeta != nil} - /// Clears the value of `configurationBeta`. Subsequent reads from it will return its default value. - mutating func clearConfigurationBeta() {_uniqueStorage()._configurationBeta = nil} - - /// Name is the name for the session object. - var name: String { - get {return _storage._name} - set {_uniqueStorage()._name = newValue} - } - - /// Labels are the labels for the session object. - var labels: Dictionary { - get {return _storage._labels} - set {_uniqueStorage()._labels = newValue} - } - - /// Paused indicates whether or not to create the session pre-paused. - var paused: Bool { - get {return _storage._paused} - set {_uniqueStorage()._paused = newValue} - } - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -/// CreateRequest encodes a request for session creation. -struct Synchronization_CreateRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Prompter is the prompter identifier to use for creating sessions. - var prompter: String = String() - - /// Specification is the creation specification. - var specification: Synchronization_CreationSpecification { - get {return _specification ?? Synchronization_CreationSpecification()} - set {_specification = newValue} - } - /// Returns true if `specification` has been explicitly set. - var hasSpecification: Bool {return self._specification != nil} - /// Clears the value of `specification`. Subsequent reads from it will return its default value. - mutating func clearSpecification() {self._specification = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _specification: Synchronization_CreationSpecification? = nil -} - -/// CreateResponse encodes a session creation response. -struct Synchronization_CreateResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Session is the resulting session identifier. - var session: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// ListRequest encodes a request for session metadata. -struct Synchronization_ListRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Selection is the session selection criteria. - var selection: Selection_Selection { - get {return _selection ?? Selection_Selection()} - set {_selection = newValue} - } - /// Returns true if `selection` has been explicitly set. - var hasSelection: Bool {return self._selection != nil} - /// Clears the value of `selection`. Subsequent reads from it will return its default value. - mutating func clearSelection() {self._selection = nil} - - /// PreviousStateIndex is the previously seen state index. 0 may be provided - /// to force an immediate state listing. - var previousStateIndex: UInt64 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _selection: Selection_Selection? = nil -} - -/// ListResponse encodes session metadata. -struct Synchronization_ListResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// StateIndex is the state index associated with the session metadata. - var stateIndex: UInt64 = 0 - - /// SessionStates are the session metadata states. - var sessionStates: [Synchronization_State] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// FlushRequest encodes a request to flush sessions. -struct Synchronization_FlushRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Prompter is the prompter to use for status message updates. - var prompter: String = String() - - /// Selection is the session selection criteria. - var selection: Selection_Selection { - get {return _selection ?? Selection_Selection()} - set {_selection = newValue} - } - /// Returns true if `selection` has been explicitly set. - var hasSelection: Bool {return self._selection != nil} - /// Clears the value of `selection`. Subsequent reads from it will return its default value. - mutating func clearSelection() {self._selection = nil} - - /// SkipWait indicates whether or not the operation should avoid blocking. - var skipWait: Bool = false - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _selection: Selection_Selection? = nil -} - -/// FlushResponse indicates completion of flush operation(s). -struct Synchronization_FlushResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// PauseRequest encodes a request to pause sessions. -struct Synchronization_PauseRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Prompter is the prompter to use for status message updates. - var prompter: String = String() - - /// Selection is the session selection criteria. - var selection: Selection_Selection { - get {return _selection ?? Selection_Selection()} - set {_selection = newValue} - } - /// Returns true if `selection` has been explicitly set. - var hasSelection: Bool {return self._selection != nil} - /// Clears the value of `selection`. Subsequent reads from it will return its default value. - mutating func clearSelection() {self._selection = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _selection: Selection_Selection? = nil -} - -/// PauseResponse indicates completion of pause operation(s). -struct Synchronization_PauseResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// ResumeRequest encodes a request to resume sessions. -struct Synchronization_ResumeRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Prompter is the prompter identifier to use for resuming sessions. - var prompter: String = String() - - /// Selection is the session selection criteria. - var selection: Selection_Selection { - get {return _selection ?? Selection_Selection()} - set {_selection = newValue} - } - /// Returns true if `selection` has been explicitly set. - var hasSelection: Bool {return self._selection != nil} - /// Clears the value of `selection`. Subsequent reads from it will return its default value. - mutating func clearSelection() {self._selection = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _selection: Selection_Selection? = nil -} - -/// ResumeResponse indicates completion of resume operation(s). -struct Synchronization_ResumeResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// ResetRequest encodes a request to reset sessions. -struct Synchronization_ResetRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Prompter is the prompter identifier to use for resetting sessions. - var prompter: String = String() - - /// Selection is the session selection criteria. - var selection: Selection_Selection { - get {return _selection ?? Selection_Selection()} - set {_selection = newValue} - } - /// Returns true if `selection` has been explicitly set. - var hasSelection: Bool {return self._selection != nil} - /// Clears the value of `selection`. Subsequent reads from it will return its default value. - mutating func clearSelection() {self._selection = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _selection: Selection_Selection? = nil -} - -/// ResetResponse indicates completion of reset operation(s). -struct Synchronization_ResetResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -/// TerminateRequest encodes a request to terminate sessions. -struct Synchronization_TerminateRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Prompter is the prompter to use for status message updates. - var prompter: String = String() - - /// Selection is the session selection criteria. - var selection: Selection_Selection { - get {return _selection ?? Selection_Selection()} - set {_selection = newValue} - } - /// Returns true if `selection` has been explicitly set. - var hasSelection: Bool {return self._selection != nil} - /// Clears the value of `selection`. Subsequent reads from it will return its default value. - mutating func clearSelection() {self._selection = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _selection: Selection_Selection? = nil -} - -/// TerminateResponse indicates completion of termination operation(s). -struct Synchronization_TerminateResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "synchronization" - -extension Synchronization_CreationSpecification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".CreationSpecification" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "alpha"), - 2: .same(proto: "beta"), - 3: .same(proto: "configuration"), - 4: .same(proto: "configurationAlpha"), - 5: .same(proto: "configurationBeta"), - 6: .same(proto: "name"), - 7: .same(proto: "labels"), - 8: .same(proto: "paused"), - ] - - fileprivate class _StorageClass { - var _alpha: Url_URL? = nil - var _beta: Url_URL? = nil - var _configuration: Synchronization_Configuration? = nil - var _configurationAlpha: Synchronization_Configuration? = nil - var _configurationBeta: Synchronization_Configuration? = nil - var _name: String = String() - var _labels: Dictionary = [:] - var _paused: Bool = false - - #if swift(>=5.10) - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - #else - static let defaultInstance = _StorageClass() - #endif - - private init() {} - - init(copying source: _StorageClass) { - _alpha = source._alpha - _beta = source._beta - _configuration = source._configuration - _configurationAlpha = source._configurationAlpha - _configurationBeta = source._configurationBeta - _name = source._name - _labels = source._labels - _paused = source._paused - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._alpha) }() - case 2: try { try decoder.decodeSingularMessageField(value: &_storage._beta) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._configuration) }() - case 4: try { try decoder.decodeSingularMessageField(value: &_storage._configurationAlpha) }() - case 5: try { try decoder.decodeSingularMessageField(value: &_storage._configurationBeta) }() - case 6: try { try decoder.decodeSingularStringField(value: &_storage._name) }() - case 7: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._labels) }() - case 8: try { try decoder.decodeSingularBoolField(value: &_storage._paused) }() - default: break - } - } - } - } - - func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._alpha { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - try { if let v = _storage._beta { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = _storage._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = _storage._configurationAlpha { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = _storage._configurationBeta { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - if !_storage._name.isEmpty { - try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 6) - } - if !_storage._labels.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._labels, fieldNumber: 7) - } - if _storage._paused != false { - try visitor.visitSingularBoolField(value: _storage._paused, fieldNumber: 8) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_CreationSpecification, rhs: Synchronization_CreationSpecification) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._alpha != rhs_storage._alpha {return false} - if _storage._beta != rhs_storage._beta {return false} - if _storage._configuration != rhs_storage._configuration {return false} - if _storage._configurationAlpha != rhs_storage._configurationAlpha {return false} - if _storage._configurationBeta != rhs_storage._configurationBeta {return false} - if _storage._name != rhs_storage._name {return false} - if _storage._labels != rhs_storage._labels {return false} - if _storage._paused != rhs_storage._paused {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_CreateRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".CreateRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prompter"), - 2: .same(proto: "specification"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.prompter) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._specification) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.prompter.isEmpty { - try visitor.visitSingularStringField(value: self.prompter, fieldNumber: 1) - } - try { if let v = self._specification { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_CreateRequest, rhs: Synchronization_CreateRequest) -> Bool { - if lhs.prompter != rhs.prompter {return false} - if lhs._specification != rhs._specification {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_CreateResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".CreateResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "session"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.session) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.session.isEmpty { - try visitor.visitSingularStringField(value: self.session, fieldNumber: 1) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_CreateResponse, rhs: Synchronization_CreateResponse) -> Bool { - if lhs.session != rhs.session {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_ListRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ListRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "selection"), - 2: .same(proto: "previousStateIndex"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._selection) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.previousStateIndex) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._selection { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.previousStateIndex != 0 { - try visitor.visitSingularUInt64Field(value: self.previousStateIndex, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_ListRequest, rhs: Synchronization_ListRequest) -> Bool { - if lhs._selection != rhs._selection {return false} - if lhs.previousStateIndex != rhs.previousStateIndex {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_ListResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ListResponse" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "stateIndex"), - 2: .same(proto: "sessionStates"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.stateIndex) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.sessionStates) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.stateIndex != 0 { - try visitor.visitSingularUInt64Field(value: self.stateIndex, fieldNumber: 1) - } - if !self.sessionStates.isEmpty { - try visitor.visitRepeatedMessageField(value: self.sessionStates, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_ListResponse, rhs: Synchronization_ListResponse) -> Bool { - if lhs.stateIndex != rhs.stateIndex {return false} - if lhs.sessionStates != rhs.sessionStates {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_FlushRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".FlushRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prompter"), - 2: .same(proto: "selection"), - 3: .same(proto: "skipWait"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.prompter) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._selection) }() - case 3: try { try decoder.decodeSingularBoolField(value: &self.skipWait) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.prompter.isEmpty { - try visitor.visitSingularStringField(value: self.prompter, fieldNumber: 1) - } - try { if let v = self._selection { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - if self.skipWait != false { - try visitor.visitSingularBoolField(value: self.skipWait, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_FlushRequest, rhs: Synchronization_FlushRequest) -> Bool { - if lhs.prompter != rhs.prompter {return false} - if lhs._selection != rhs._selection {return false} - if lhs.skipWait != rhs.skipWait {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_FlushResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".FlushResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_FlushResponse, rhs: Synchronization_FlushResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_PauseRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".PauseRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prompter"), - 2: .same(proto: "selection"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.prompter) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._selection) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.prompter.isEmpty { - try visitor.visitSingularStringField(value: self.prompter, fieldNumber: 1) - } - try { if let v = self._selection { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_PauseRequest, rhs: Synchronization_PauseRequest) -> Bool { - if lhs.prompter != rhs.prompter {return false} - if lhs._selection != rhs._selection {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_PauseResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".PauseResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_PauseResponse, rhs: Synchronization_PauseResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_ResumeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ResumeRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prompter"), - 2: .same(proto: "selection"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.prompter) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._selection) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.prompter.isEmpty { - try visitor.visitSingularStringField(value: self.prompter, fieldNumber: 1) - } - try { if let v = self._selection { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_ResumeRequest, rhs: Synchronization_ResumeRequest) -> Bool { - if lhs.prompter != rhs.prompter {return false} - if lhs._selection != rhs._selection {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_ResumeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ResumeResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_ResumeResponse, rhs: Synchronization_ResumeResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_ResetRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ResetRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prompter"), - 2: .same(proto: "selection"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.prompter) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._selection) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.prompter.isEmpty { - try visitor.visitSingularStringField(value: self.prompter, fieldNumber: 1) - } - try { if let v = self._selection { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_ResetRequest, rhs: Synchronization_ResetRequest) -> Bool { - if lhs.prompter != rhs.prompter {return false} - if lhs._selection != rhs._selection {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_ResetResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ResetResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_ResetResponse, rhs: Synchronization_ResetResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_TerminateRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TerminateRequest" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "prompter"), - 2: .same(proto: "selection"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.prompter) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._selection) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.prompter.isEmpty { - try visitor.visitSingularStringField(value: self.prompter, fieldNumber: 1) - } - try { if let v = self._selection { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_TerminateRequest, rhs: Synchronization_TerminateRequest) -> Bool { - if lhs.prompter != rhs.prompter {return false} - if lhs._selection != rhs._selection {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_TerminateResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".TerminateResponse" - static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_TerminateResponse, rhs: Synchronization_TerminateResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_compression_algorithm.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_compression_algorithm.pb.swift deleted file mode 100644 index 0ccc766b..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_compression_algorithm.pb.swift +++ /dev/null @@ -1,113 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_compression_algorithm.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/compression/algorithm.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Algorithm specifies a compression algorithm. -enum Compression_Algorithm: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// Algorithm_AlgorithmDefault represents an unspecified compression - /// algorithm. It should be converted to one of the following values based on - /// the desired default behavior. - case `default` // = 0 - - /// Algorithm_AlgorithmNone specifies that no compression should be used. - case none // = 1 - - /// Algorithm_AlgorithmDeflate specifies that DEFLATE compression should be - /// used. - case deflate // = 2 - - /// Algorithm_AlgorithmZstandard specifies that Zstandard compression should - /// be used. - case zstandard // = 3 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .none - case 2: self = .deflate - case 3: self = .zstandard - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .none: return 1 - case .deflate: return 2 - case .zstandard: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Compression_Algorithm] = [ - .default, - .none, - .deflate, - .zstandard, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Compression_Algorithm: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "AlgorithmDefault"), - 1: .same(proto: "AlgorithmNone"), - 2: .same(proto: "AlgorithmDeflate"), - 3: .same(proto: "AlgorithmZstandard"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_configuration.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_configuration.pb.swift deleted file mode 100644 index 5b630026..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_configuration.pb.swift +++ /dev/null @@ -1,433 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_configuration.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/configuration.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Configuration encodes session configuration parameters. It is used for create -/// commands to specify configuration options, for loading global configuration -/// options, and for storing a merged configuration inside sessions. It should be -/// considered immutable. -struct Synchronization_Configuration: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// SynchronizationMode specifies the synchronization mode that should be - /// used in synchronization. - var synchronizationMode: Core_SynchronizationMode { - get {return _storage._synchronizationMode} - set {_uniqueStorage()._synchronizationMode = newValue} - } - - /// HashingAlgorithm specifies the content hashing algorithm used to track - /// content and perform differential transfers. - var hashingAlgorithm: Hashing_Algorithm { - get {return _storage._hashingAlgorithm} - set {_uniqueStorage()._hashingAlgorithm = newValue} - } - - /// MaximumEntryCount specifies the maximum number of filesystem entries that - /// endpoints will tolerate managing. A zero value indicates no limit. - var maximumEntryCount: UInt64 { - get {return _storage._maximumEntryCount} - set {_uniqueStorage()._maximumEntryCount = newValue} - } - - /// MaximumStagingFileSize is the maximum (individual) file size that - /// endpoints will stage. A zero value indicates no limit. - var maximumStagingFileSize: UInt64 { - get {return _storage._maximumStagingFileSize} - set {_uniqueStorage()._maximumStagingFileSize = newValue} - } - - /// ProbeMode specifies the filesystem probing mode. - var probeMode: Behavior_ProbeMode { - get {return _storage._probeMode} - set {_uniqueStorage()._probeMode = newValue} - } - - /// ScanMode specifies the synchronization root scanning mode. - var scanMode: Synchronization_ScanMode { - get {return _storage._scanMode} - set {_uniqueStorage()._scanMode = newValue} - } - - /// StageMode specifies the file staging mode. - var stageMode: Synchronization_StageMode { - get {return _storage._stageMode} - set {_uniqueStorage()._stageMode = newValue} - } - - /// SymbolicLinkMode specifies the symbolic link mode. - var symbolicLinkMode: Core_SymbolicLinkMode { - get {return _storage._symbolicLinkMode} - set {_uniqueStorage()._symbolicLinkMode = newValue} - } - - /// WatchMode specifies the filesystem watching mode. - var watchMode: Synchronization_WatchMode { - get {return _storage._watchMode} - set {_uniqueStorage()._watchMode = newValue} - } - - /// WatchPollingInterval specifies the interval (in seconds) for poll-based - /// file monitoring. A value of 0 specifies that the default interval should - /// be used. - var watchPollingInterval: UInt32 { - get {return _storage._watchPollingInterval} - set {_uniqueStorage()._watchPollingInterval = newValue} - } - - /// IgnoreSyntax specifies the syntax and semantics to use for ignores. - /// NOTE: This field is out of order due to the historical order in which it - /// was added. - var ignoreSyntax: Ignore_Syntax { - get {return _storage._ignoreSyntax} - set {_uniqueStorage()._ignoreSyntax = newValue} - } - - /// DefaultIgnores specifies the ignore patterns brought in from the global - /// configuration. - /// DEPRECATED: This field is no longer used when loading from global - /// configuration. Instead, ignores provided by global configuration are - /// simply merged into the ignore list of the main configuration. However, - /// older sessions still use this field. - var defaultIgnores: [String] { - get {return _storage._defaultIgnores} - set {_uniqueStorage()._defaultIgnores = newValue} - } - - /// Ignores specifies the ignore patterns brought in from the create request. - var ignores: [String] { - get {return _storage._ignores} - set {_uniqueStorage()._ignores = newValue} - } - - /// IgnoreVCSMode specifies the VCS ignore mode that should be used in - /// synchronization. - var ignoreVcsmode: Ignore_IgnoreVCSMode { - get {return _storage._ignoreVcsmode} - set {_uniqueStorage()._ignoreVcsmode = newValue} - } - - /// PermissionsMode species the manner in which permissions should be - /// propagated between endpoints. - var permissionsMode: Core_PermissionsMode { - get {return _storage._permissionsMode} - set {_uniqueStorage()._permissionsMode = newValue} - } - - /// DefaultFileMode specifies the default permission mode to use for new - /// files in "portable" permission propagation mode. - var defaultFileMode: UInt32 { - get {return _storage._defaultFileMode} - set {_uniqueStorage()._defaultFileMode = newValue} - } - - /// DefaultDirectoryMode specifies the default permission mode to use for new - /// files in "portable" permission propagation mode. - var defaultDirectoryMode: UInt32 { - get {return _storage._defaultDirectoryMode} - set {_uniqueStorage()._defaultDirectoryMode = newValue} - } - - /// DefaultOwner specifies the default owner identifier to use when setting - /// ownership of new files and directories in "portable" permission - /// propagation mode. - var defaultOwner: String { - get {return _storage._defaultOwner} - set {_uniqueStorage()._defaultOwner = newValue} - } - - /// DefaultGroup specifies the default group identifier to use when setting - /// ownership of new files and directories in "portable" permission - /// propagation mode. - var defaultGroup: String { - get {return _storage._defaultGroup} - set {_uniqueStorage()._defaultGroup = newValue} - } - - /// CompressionAlgorithm specifies the compression algorithm to use when - /// communicating with the endpoint. This only applies to remote endpoints. - var compressionAlgorithm: Compression_Algorithm { - get {return _storage._compressionAlgorithm} - set {_uniqueStorage()._compressionAlgorithm = newValue} - } - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "synchronization" - -extension Synchronization_Configuration: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Configuration" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 11: .same(proto: "synchronizationMode"), - 17: .same(proto: "hashingAlgorithm"), - 12: .same(proto: "maximumEntryCount"), - 13: .same(proto: "maximumStagingFileSize"), - 14: .same(proto: "probeMode"), - 15: .same(proto: "scanMode"), - 16: .same(proto: "stageMode"), - 1: .same(proto: "symbolicLinkMode"), - 21: .same(proto: "watchMode"), - 22: .same(proto: "watchPollingInterval"), - 34: .same(proto: "ignoreSyntax"), - 31: .same(proto: "defaultIgnores"), - 32: .same(proto: "ignores"), - 33: .same(proto: "ignoreVCSMode"), - 61: .same(proto: "permissionsMode"), - 63: .same(proto: "defaultFileMode"), - 64: .same(proto: "defaultDirectoryMode"), - 65: .same(proto: "defaultOwner"), - 66: .same(proto: "defaultGroup"), - 81: .same(proto: "compressionAlgorithm"), - ] - - fileprivate class _StorageClass { - var _synchronizationMode: Core_SynchronizationMode = .default - var _hashingAlgorithm: Hashing_Algorithm = .default - var _maximumEntryCount: UInt64 = 0 - var _maximumStagingFileSize: UInt64 = 0 - var _probeMode: Behavior_ProbeMode = .default - var _scanMode: Synchronization_ScanMode = .default - var _stageMode: Synchronization_StageMode = .default - var _symbolicLinkMode: Core_SymbolicLinkMode = .default - var _watchMode: Synchronization_WatchMode = .default - var _watchPollingInterval: UInt32 = 0 - var _ignoreSyntax: Ignore_Syntax = .default - var _defaultIgnores: [String] = [] - var _ignores: [String] = [] - var _ignoreVcsmode: Ignore_IgnoreVCSMode = .default - var _permissionsMode: Core_PermissionsMode = .default - var _defaultFileMode: UInt32 = 0 - var _defaultDirectoryMode: UInt32 = 0 - var _defaultOwner: String = String() - var _defaultGroup: String = String() - var _compressionAlgorithm: Compression_Algorithm = .default - - #if swift(>=5.10) - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - #else - static let defaultInstance = _StorageClass() - #endif - - private init() {} - - init(copying source: _StorageClass) { - _synchronizationMode = source._synchronizationMode - _hashingAlgorithm = source._hashingAlgorithm - _maximumEntryCount = source._maximumEntryCount - _maximumStagingFileSize = source._maximumStagingFileSize - _probeMode = source._probeMode - _scanMode = source._scanMode - _stageMode = source._stageMode - _symbolicLinkMode = source._symbolicLinkMode - _watchMode = source._watchMode - _watchPollingInterval = source._watchPollingInterval - _ignoreSyntax = source._ignoreSyntax - _defaultIgnores = source._defaultIgnores - _ignores = source._ignores - _ignoreVcsmode = source._ignoreVcsmode - _permissionsMode = source._permissionsMode - _defaultFileMode = source._defaultFileMode - _defaultDirectoryMode = source._defaultDirectoryMode - _defaultOwner = source._defaultOwner - _defaultGroup = source._defaultGroup - _compressionAlgorithm = source._compressionAlgorithm - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &_storage._symbolicLinkMode) }() - case 11: try { try decoder.decodeSingularEnumField(value: &_storage._synchronizationMode) }() - case 12: try { try decoder.decodeSingularUInt64Field(value: &_storage._maximumEntryCount) }() - case 13: try { try decoder.decodeSingularUInt64Field(value: &_storage._maximumStagingFileSize) }() - case 14: try { try decoder.decodeSingularEnumField(value: &_storage._probeMode) }() - case 15: try { try decoder.decodeSingularEnumField(value: &_storage._scanMode) }() - case 16: try { try decoder.decodeSingularEnumField(value: &_storage._stageMode) }() - case 17: try { try decoder.decodeSingularEnumField(value: &_storage._hashingAlgorithm) }() - case 21: try { try decoder.decodeSingularEnumField(value: &_storage._watchMode) }() - case 22: try { try decoder.decodeSingularUInt32Field(value: &_storage._watchPollingInterval) }() - case 31: try { try decoder.decodeRepeatedStringField(value: &_storage._defaultIgnores) }() - case 32: try { try decoder.decodeRepeatedStringField(value: &_storage._ignores) }() - case 33: try { try decoder.decodeSingularEnumField(value: &_storage._ignoreVcsmode) }() - case 34: try { try decoder.decodeSingularEnumField(value: &_storage._ignoreSyntax) }() - case 61: try { try decoder.decodeSingularEnumField(value: &_storage._permissionsMode) }() - case 63: try { try decoder.decodeSingularUInt32Field(value: &_storage._defaultFileMode) }() - case 64: try { try decoder.decodeSingularUInt32Field(value: &_storage._defaultDirectoryMode) }() - case 65: try { try decoder.decodeSingularStringField(value: &_storage._defaultOwner) }() - case 66: try { try decoder.decodeSingularStringField(value: &_storage._defaultGroup) }() - case 81: try { try decoder.decodeSingularEnumField(value: &_storage._compressionAlgorithm) }() - default: break - } - } - } - } - - func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - if _storage._symbolicLinkMode != .default { - try visitor.visitSingularEnumField(value: _storage._symbolicLinkMode, fieldNumber: 1) - } - if _storage._synchronizationMode != .default { - try visitor.visitSingularEnumField(value: _storage._synchronizationMode, fieldNumber: 11) - } - if _storage._maximumEntryCount != 0 { - try visitor.visitSingularUInt64Field(value: _storage._maximumEntryCount, fieldNumber: 12) - } - if _storage._maximumStagingFileSize != 0 { - try visitor.visitSingularUInt64Field(value: _storage._maximumStagingFileSize, fieldNumber: 13) - } - if _storage._probeMode != .default { - try visitor.visitSingularEnumField(value: _storage._probeMode, fieldNumber: 14) - } - if _storage._scanMode != .default { - try visitor.visitSingularEnumField(value: _storage._scanMode, fieldNumber: 15) - } - if _storage._stageMode != .default { - try visitor.visitSingularEnumField(value: _storage._stageMode, fieldNumber: 16) - } - if _storage._hashingAlgorithm != .default { - try visitor.visitSingularEnumField(value: _storage._hashingAlgorithm, fieldNumber: 17) - } - if _storage._watchMode != .default { - try visitor.visitSingularEnumField(value: _storage._watchMode, fieldNumber: 21) - } - if _storage._watchPollingInterval != 0 { - try visitor.visitSingularUInt32Field(value: _storage._watchPollingInterval, fieldNumber: 22) - } - if !_storage._defaultIgnores.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._defaultIgnores, fieldNumber: 31) - } - if !_storage._ignores.isEmpty { - try visitor.visitRepeatedStringField(value: _storage._ignores, fieldNumber: 32) - } - if _storage._ignoreVcsmode != .default { - try visitor.visitSingularEnumField(value: _storage._ignoreVcsmode, fieldNumber: 33) - } - if _storage._ignoreSyntax != .default { - try visitor.visitSingularEnumField(value: _storage._ignoreSyntax, fieldNumber: 34) - } - if _storage._permissionsMode != .default { - try visitor.visitSingularEnumField(value: _storage._permissionsMode, fieldNumber: 61) - } - if _storage._defaultFileMode != 0 { - try visitor.visitSingularUInt32Field(value: _storage._defaultFileMode, fieldNumber: 63) - } - if _storage._defaultDirectoryMode != 0 { - try visitor.visitSingularUInt32Field(value: _storage._defaultDirectoryMode, fieldNumber: 64) - } - if !_storage._defaultOwner.isEmpty { - try visitor.visitSingularStringField(value: _storage._defaultOwner, fieldNumber: 65) - } - if !_storage._defaultGroup.isEmpty { - try visitor.visitSingularStringField(value: _storage._defaultGroup, fieldNumber: 66) - } - if _storage._compressionAlgorithm != .default { - try visitor.visitSingularEnumField(value: _storage._compressionAlgorithm, fieldNumber: 81) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_Configuration, rhs: Synchronization_Configuration) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._synchronizationMode != rhs_storage._synchronizationMode {return false} - if _storage._hashingAlgorithm != rhs_storage._hashingAlgorithm {return false} - if _storage._maximumEntryCount != rhs_storage._maximumEntryCount {return false} - if _storage._maximumStagingFileSize != rhs_storage._maximumStagingFileSize {return false} - if _storage._probeMode != rhs_storage._probeMode {return false} - if _storage._scanMode != rhs_storage._scanMode {return false} - if _storage._stageMode != rhs_storage._stageMode {return false} - if _storage._symbolicLinkMode != rhs_storage._symbolicLinkMode {return false} - if _storage._watchMode != rhs_storage._watchMode {return false} - if _storage._watchPollingInterval != rhs_storage._watchPollingInterval {return false} - if _storage._ignoreSyntax != rhs_storage._ignoreSyntax {return false} - if _storage._defaultIgnores != rhs_storage._defaultIgnores {return false} - if _storage._ignores != rhs_storage._ignores {return false} - if _storage._ignoreVcsmode != rhs_storage._ignoreVcsmode {return false} - if _storage._permissionsMode != rhs_storage._permissionsMode {return false} - if _storage._defaultFileMode != rhs_storage._defaultFileMode {return false} - if _storage._defaultDirectoryMode != rhs_storage._defaultDirectoryMode {return false} - if _storage._defaultOwner != rhs_storage._defaultOwner {return false} - if _storage._defaultGroup != rhs_storage._defaultGroup {return false} - if _storage._compressionAlgorithm != rhs_storage._compressionAlgorithm {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_change.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_change.pb.swift deleted file mode 100644 index e24e33dc..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_change.pb.swift +++ /dev/null @@ -1,140 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_change.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/change.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Change encodes a change to an entry hierarchy. Change objects should be -/// considered immutable and must not be modified. -struct Core_Change: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Path is the path of the root of the change (relative to the - /// synchronization root). - var path: String = String() - - /// Old represents the old filesystem hierarchy at the change path. It may be - /// nil if no content previously existed. - var old: Core_Entry { - get {return _old ?? Core_Entry()} - set {_old = newValue} - } - /// Returns true if `old` has been explicitly set. - var hasOld: Bool {return self._old != nil} - /// Clears the value of `old`. Subsequent reads from it will return its default value. - mutating func clearOld() {self._old = nil} - - /// New represents the new filesystem hierarchy at the change path. It may be - /// nil if content has been deleted. - var new: Core_Entry { - get {return _new ?? Core_Entry()} - set {_new = newValue} - } - /// Returns true if `new` has been explicitly set. - var hasNew: Bool {return self._new != nil} - /// Clears the value of `new`. Subsequent reads from it will return its default value. - mutating func clearNew() {self._new = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _old: Core_Entry? = nil - fileprivate var _new: Core_Entry? = nil -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "core" - -extension Core_Change: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Change" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "path"), - 2: .same(proto: "old"), - 3: .same(proto: "new"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.path) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._old) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._new) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.path.isEmpty { - try visitor.visitSingularStringField(value: self.path, fieldNumber: 1) - } - try { if let v = self._old { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._new { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Core_Change, rhs: Core_Change) -> Bool { - if lhs.path != rhs.path {return false} - if lhs._old != rhs._old {return false} - if lhs._new != rhs._new {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_conflict.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_conflict.pb.swift deleted file mode 100644 index d3bc3f47..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_conflict.pb.swift +++ /dev/null @@ -1,123 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_conflict.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/conflict.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Conflict encodes conflicting changes on alpha and beta that prevent -/// synchronization of a particular path. Conflict objects should be considered -/// immutable and must not be modified. -struct Core_Conflict: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Root is the root path for the conflict (relative to the synchronization - /// root). While this can (in theory) be computed based on the change lists - /// contained within the conflict, doing so relies on those change lists - /// being constructed and ordered in a particular manner that's not possible - /// to enforce. Additionally, conflicts are often sorted by their root path, - /// and dynamically computing it on every sort comparison operation would be - /// prohibitively expensive. - var root: String = String() - - /// AlphaChanges are the relevant changes on alpha. - var alphaChanges: [Core_Change] = [] - - /// BetaChanges are the relevant changes on beta. - var betaChanges: [Core_Change] = [] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "core" - -extension Core_Conflict: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Conflict" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "root"), - 2: .same(proto: "alphaChanges"), - 3: .same(proto: "betaChanges"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.root) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.alphaChanges) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.betaChanges) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.root.isEmpty { - try visitor.visitSingularStringField(value: self.root, fieldNumber: 1) - } - if !self.alphaChanges.isEmpty { - try visitor.visitRepeatedMessageField(value: self.alphaChanges, fieldNumber: 2) - } - if !self.betaChanges.isEmpty { - try visitor.visitRepeatedMessageField(value: self.betaChanges, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Core_Conflict, rhs: Core_Conflict) -> Bool { - if lhs.root != rhs.root {return false} - if lhs.alphaChanges != rhs.alphaChanges {return false} - if lhs.betaChanges != rhs.betaChanges {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_entry.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_entry.pb.swift deleted file mode 100644 index 9b40020f..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_entry.pb.swift +++ /dev/null @@ -1,245 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_entry.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/entry.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// EntryKind encodes the type of entry represented by an Entry object. -enum Core_EntryKind: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// EntryKind_Directory indicates a directory. - case directory // = 0 - - /// EntryKind_File indicates a regular file. - case file // = 1 - - /// EntryKind_SymbolicLink indicates a symbolic link. - case symbolicLink // = 2 - - /// EntryKind_Untracked indicates content (or the root of content) that is - /// intentionally excluded from synchronization by Mutagen. This includes - /// explicitly ignored content, content that is ignored due to settings (such - /// as symbolic links in the "ignore" symbolic link mode), as well as content - /// types that Mutagen doesn't understand and/or have a way to propagate - /// (such as FIFOs and Unix domain sockets). This type of entry is not - /// synchronizable. - case untracked // = 100 - - /// EntryKind_Problematic indicates content (or the root of content) that - /// would normally be synchronized, but which is currently inaccessible to - /// scanning. This includes (but is not limited to) content that is modified - /// concurrently with scanning, content that is inaccessible due to - /// permissions, content that can't be read due to filesystem errors, content - /// that cannot be properly encoded given the current settings (such as - /// absolute symbolic links found when using the "portable" symbolic link - /// mode), and content that Mutagen cannot scan or watch reliably (such as - /// directories that are also mount points). This type of entry is not - /// synchronizable. - case problematic // = 101 - - /// EntryKind_PhantomDirectory indicates a directory that was recorded with - /// an ignore mask. This type is used to support Docker-style ignore syntax - /// and semantics, which allow directories to be unignored by child content - /// that is explicitly unignored. This type is pseudo-synchronizable; entries - /// containing phantom contents must have those contents reified (to tracked - /// or ignored directories) using ReifyPhantomDirectories before Reconcile. - case phantomDirectory // = 102 - case UNRECOGNIZED(Int) - - init() { - self = .directory - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .directory - case 1: self = .file - case 2: self = .symbolicLink - case 100: self = .untracked - case 101: self = .problematic - case 102: self = .phantomDirectory - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .directory: return 0 - case .file: return 1 - case .symbolicLink: return 2 - case .untracked: return 100 - case .problematic: return 101 - case .phantomDirectory: return 102 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Core_EntryKind] = [ - .directory, - .file, - .symbolicLink, - .untracked, - .problematic, - .phantomDirectory, - ] - -} - -/// Entry encodes a filesystem entry (e.g. a directory, a file, or a symbolic -/// link). A nil Entry represents an absence of content. An zero-value Entry -/// represents an empty Directory. Entry objects should be considered immutable -/// and must not be modified. -struct Core_Entry: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Kind encodes the type of filesystem entry being represented. - var kind: Core_EntryKind = .directory - - /// Contents represents a directory entry's contents. It must only be non-nil - /// for directory entries. - var contents: Dictionary = [:] - - /// Digest represents the hash of a file entry's contents. It must only be - /// non-nil for file entries. - var digest: Data = Data() - - /// Executable indicates whether or not a file entry is marked as executable. - /// It must only be set (if appropriate) for file entries. - var executable: Bool = false - - /// Target is the symbolic link target for symbolic link entries. It must be - /// non-empty if and only if the entry is a symbolic link. - var target: String = String() - - /// Problem indicates the relevant error for problematic content. It must be - /// non-empty if and only if the entry represents problematic content. - var problem: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "core" - -extension Core_EntryKind: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "Directory"), - 1: .same(proto: "File"), - 2: .same(proto: "SymbolicLink"), - 100: .same(proto: "Untracked"), - 101: .same(proto: "Problematic"), - 102: .same(proto: "PhantomDirectory"), - ] -} - -extension Core_Entry: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Entry" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "kind"), - 5: .same(proto: "contents"), - 8: .same(proto: "digest"), - 9: .same(proto: "executable"), - 12: .same(proto: "target"), - 15: .same(proto: "problem"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.kind) }() - case 5: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.contents) }() - case 8: try { try decoder.decodeSingularBytesField(value: &self.digest) }() - case 9: try { try decoder.decodeSingularBoolField(value: &self.executable) }() - case 12: try { try decoder.decodeSingularStringField(value: &self.target) }() - case 15: try { try decoder.decodeSingularStringField(value: &self.problem) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.kind != .directory { - try visitor.visitSingularEnumField(value: self.kind, fieldNumber: 1) - } - if !self.contents.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.contents, fieldNumber: 5) - } - if !self.digest.isEmpty { - try visitor.visitSingularBytesField(value: self.digest, fieldNumber: 8) - } - if self.executable != false { - try visitor.visitSingularBoolField(value: self.executable, fieldNumber: 9) - } - if !self.target.isEmpty { - try visitor.visitSingularStringField(value: self.target, fieldNumber: 12) - } - if !self.problem.isEmpty { - try visitor.visitSingularStringField(value: self.problem, fieldNumber: 15) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Core_Entry, rhs: Core_Entry) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.contents != rhs.contents {return false} - if lhs.digest != rhs.digest {return false} - if lhs.executable != rhs.executable {return false} - if lhs.target != rhs.target {return false} - if lhs.problem != rhs.problem {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_ignore_vcs_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_ignore_vcs_mode.pb.swift deleted file mode 100644 index d91cd128..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_ignore_vcs_mode.pb.swift +++ /dev/null @@ -1,106 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_ignore_ignore_vcs_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/ignore/ignore_vcs_mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// IgnoreVCSMode specifies the mode for ignoring VCS directories. -enum Ignore_IgnoreVCSMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// IgnoreVCSMode_IgnoreVCSModeDefault represents an unspecified VCS ignore - /// mode. It is not valid for use with Scan. It should be converted to one of - /// the following values based on the desired default behavior. - case `default` // = 0 - - /// IgnoreVCSMode_IgnoreVCSModeIgnore indicates that VCS directories should - /// be ignored. - case ignore // = 1 - - /// IgnoreVCSMode_IgnoreVCSModePropagate indicates that VCS directories - /// should be propagated. - case propagate // = 2 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .ignore - case 2: self = .propagate - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .ignore: return 1 - case .propagate: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Ignore_IgnoreVCSMode] = [ - .default, - .ignore, - .propagate, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Ignore_IgnoreVCSMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "IgnoreVCSModeDefault"), - 1: .same(proto: "IgnoreVCSModeIgnore"), - 2: .same(proto: "IgnoreVCSModePropagate"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_syntax.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_syntax.pb.swift deleted file mode 100644 index 773c2015..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_syntax.pb.swift +++ /dev/null @@ -1,106 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_ignore_syntax.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/ignore/syntax.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Syntax specifies the syntax and semantics for ignore specifications. -enum Ignore_Syntax: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// Syntax_SyntaxDefault represents an unspecified ignore syntax. It is not - /// valid for use with core synchronization functions. It should be converted - /// to one of the following values based on the desired default behavior. - case `default` // = 0 - - /// Syntax_SyntaxMutagen specifies that Mutagen-style ignore syntax and - /// semantics should be used. - case mutagen // = 1 - - /// Syntax_SyntaxDocker specifies that Docker-style ignore syntax and - /// semantics should be used. - case docker // = 2 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .mutagen - case 2: self = .docker - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .mutagen: return 1 - case .docker: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Ignore_Syntax] = [ - .default, - .mutagen, - .docker, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Ignore_Syntax: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SyntaxDefault"), - 1: .same(proto: "SyntaxMutagen"), - 2: .same(proto: "SyntaxDocker"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_mode.pb.swift deleted file mode 100644 index f192c992..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_mode.pb.swift +++ /dev/null @@ -1,135 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// SynchronizationMode specifies the mode for synchronization, encoding both -/// directionality and conflict resolution behavior. -enum Core_SynchronizationMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// SynchronizationMode_SynchronizationModeDefault represents an unspecified - /// synchronization mode. It is not valid for use with Reconcile. It should - /// be converted to one of the following values based on the desired default - /// behavior. - case `default` // = 0 - - /// SynchronizationMode_SynchronizationModeTwoWaySafe represents a - /// bidirectional synchronization mode where automatic conflict resolution is - /// performed only in cases where no data would be lost. Specifically, this - /// means that modified contents are allowed to propagate to the opposite - /// endpoint if the corresponding contents on the opposite endpoint are - /// unmodified or deleted. All other conflicts are left unresolved. - case twoWaySafe // = 1 - - /// SynchronizationMode_SynchronizationModeTwoWayResolved is the same as - /// SynchronizationMode_SynchronizationModeTwoWaySafe, but specifies that the - /// alpha endpoint should win automatically in any conflict between alpha and - /// beta, including cases where alpha has deleted contents that beta has - /// modified. - case twoWayResolved // = 2 - - /// SynchronizationMode_SynchronizationModeOneWaySafe represents a - /// unidirectional synchronization mode where contents and changes propagate - /// from alpha to beta, but won't overwrite any creations or modifications on - /// beta. - case oneWaySafe // = 3 - - /// SynchronizationMode_SynchronizationModeOneWayReplica represents a - /// unidirectional synchronization mode where contents on alpha are mirrored - /// (verbatim) to beta, overwriting any conflicting contents on beta and - /// deleting any extraneous contents on beta. - case oneWayReplica // = 4 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .twoWaySafe - case 2: self = .twoWayResolved - case 3: self = .oneWaySafe - case 4: self = .oneWayReplica - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .twoWaySafe: return 1 - case .twoWayResolved: return 2 - case .oneWaySafe: return 3 - case .oneWayReplica: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Core_SynchronizationMode] = [ - .default, - .twoWaySafe, - .twoWayResolved, - .oneWaySafe, - .oneWayReplica, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Core_SynchronizationMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SynchronizationModeDefault"), - 1: .same(proto: "SynchronizationModeTwoWaySafe"), - 2: .same(proto: "SynchronizationModeTwoWayResolved"), - 3: .same(proto: "SynchronizationModeOneWaySafe"), - 4: .same(proto: "SynchronizationModeOneWayReplica"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_permissions_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_permissions_mode.pb.swift deleted file mode 100644 index 6a4d9cfa..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_permissions_mode.pb.swift +++ /dev/null @@ -1,110 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_permissions_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/permissions_mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// PermissionsMode specifies the mode for handling permission propagation. -enum Core_PermissionsMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// PermissionsMode_PermissionsModeDefault represents an unspecified - /// permissions mode. It is not valid for use with Scan. It should be - /// converted to one of the following values based on the desired default - /// behavior. - case `default` // = 0 - - /// PermissionsMode_PermissionsModePortable specifies that permissions should - /// be propagated in a portable fashion. This means that only executability - /// bits are managed by Mutagen and that manual specifications for ownership - /// and base file permissions are used. - case portable // = 1 - - /// PermissionsMode_PermissionsModeManual specifies that only manual - /// permission specifications should be used. In this case, Mutagen does not - /// perform any propagation of permissions. - case manual // = 2 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .portable - case 2: self = .manual - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .portable: return 1 - case .manual: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Core_PermissionsMode] = [ - .default, - .portable, - .manual, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Core_PermissionsMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "PermissionsModeDefault"), - 1: .same(proto: "PermissionsModePortable"), - 2: .same(proto: "PermissionsModeManual"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_problem.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_problem.pb.swift deleted file mode 100644 index 5edcf9e5..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_problem.pb.swift +++ /dev/null @@ -1,109 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_problem.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/problem.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Problem indicates an issue or error encountered at some stage of a -/// synchronization cycle. Problem objects should be considered immutable and -/// must not be modified. -struct Core_Problem: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Path is the path at which the problem occurred (relative to the - /// synchronization root). - var path: String = String() - - /// Error is a human-readable summary of the problem. - var error: String = String() - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "core" - -extension Core_Problem: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Problem" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "path"), - 2: .same(proto: "error"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.path) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.error) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.path.isEmpty { - try visitor.visitSingularStringField(value: self.path, fieldNumber: 1) - } - if !self.error.isEmpty { - try visitor.visitSingularStringField(value: self.error, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Core_Problem, rhs: Core_Problem) -> Bool { - if lhs.path != rhs.path {return false} - if lhs.error != rhs.error {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_symbolic_link_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_symbolic_link_mode.pb.swift deleted file mode 100644 index 55763f5a..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_symbolic_link_mode.pb.swift +++ /dev/null @@ -1,118 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_core_symbolic_link_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/core/symbolic_link_mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// SymbolicLinkMode specifies the mode for handling symbolic links. -enum Core_SymbolicLinkMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// SymbolicLinkMode_SymbolicLinkModeDefault represents an unspecified - /// symbolic link mode. It is not valid for use with Scan or Transition. It - /// should be converted to one of the following values based on the desired - /// default behavior. - case `default` // = 0 - - /// SymbolicLinkMode_SymbolicLinkModeIgnore specifies that all symbolic links - /// should be ignored. - case ignore // = 1 - - /// SymbolicLinkMode_SymbolicLinkModePortable specifies that only portable - /// symbolic links should be synchronized. Any absolute symbolic links or - /// symbolic links which are otherwise non-portable will be treate as - /// problematic content. - case portable // = 2 - - /// SymbolicLinkMode_SymbolicLinkModePOSIXRaw specifies that symbolic links - /// should be propagated in their raw form. It is only valid on POSIX systems - /// and only makes sense in the context of POSIX-to-POSIX synchronization. - case posixraw // = 3 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .ignore - case 2: self = .portable - case 3: self = .posixraw - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .ignore: return 1 - case .portable: return 2 - case .posixraw: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Core_SymbolicLinkMode] = [ - .default, - .ignore, - .portable, - .posixraw, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Core_SymbolicLinkMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "SymbolicLinkModeDefault"), - 1: .same(proto: "SymbolicLinkModeIgnore"), - 2: .same(proto: "SymbolicLinkModePortable"), - 3: .same(proto: "SymbolicLinkModePOSIXRaw"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_hashing_algorithm.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_hashing_algorithm.pb.swift deleted file mode 100644 index 247beffb..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_hashing_algorithm.pb.swift +++ /dev/null @@ -1,111 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_hashing_algorithm.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/hashing/algorithm.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Algorithm specifies a hashing algorithm. -enum Hashing_Algorithm: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// Algorithm_AlgorithmDefault represents an unspecified hashing algorithm. - /// It should be converted to one of the following values based on the - /// desired default behavior. - case `default` // = 0 - - /// Algorithm_AlgorithmSHA1 specifies that SHA-1 hashing should be used. - case sha1 // = 1 - - /// Algorithm_AlgorithmSHA256 specifies that SHA-256 hashing should be used. - case sha256 // = 2 - - /// Algorithm_AlgorithmXXH128 specifies that XXH128 hashing should be used. - case xxh128 // = 3 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .sha1 - case 2: self = .sha256 - case 3: self = .xxh128 - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .sha1: return 1 - case .sha256: return 2 - case .xxh128: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Hashing_Algorithm] = [ - .default, - .sha1, - .sha256, - .xxh128, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Hashing_Algorithm: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "AlgorithmDefault"), - 1: .same(proto: "AlgorithmSHA1"), - 2: .same(proto: "AlgorithmSHA256"), - 3: .same(proto: "AlgorithmXXH128"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_rsync_receive.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_rsync_receive.pb.swift deleted file mode 100644 index efb63b96..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_rsync_receive.pb.swift +++ /dev/null @@ -1,145 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_rsync_receive.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/rsync/receive.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// ReceiverState encodes that status of an rsync receiver. It should be -/// considered immutable. -struct Rsync_ReceiverState: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Path is the path currently being received. - var path: String = String() - - /// ReceivedSize is the number of bytes that have been received for the - /// current path from both block and data operations. - var receivedSize: UInt64 = 0 - - /// ExpectedSize is the number of bytes expected for the current path. - var expectedSize: UInt64 = 0 - - /// ReceivedFiles is the number of files that have already been received. - var receivedFiles: UInt64 = 0 - - /// ExpectedFiles is the total number of files expected. - var expectedFiles: UInt64 = 0 - - /// TotalReceivedSize is the total number of bytes that have been received - /// for all files from both block and data operations. - var totalReceivedSize: UInt64 = 0 - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "rsync" - -extension Rsync_ReceiverState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".ReceiverState" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "path"), - 2: .same(proto: "receivedSize"), - 3: .same(proto: "expectedSize"), - 4: .same(proto: "receivedFiles"), - 5: .same(proto: "expectedFiles"), - 6: .same(proto: "totalReceivedSize"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.path) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.receivedSize) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.expectedSize) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.receivedFiles) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &self.expectedFiles) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &self.totalReceivedSize) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if !self.path.isEmpty { - try visitor.visitSingularStringField(value: self.path, fieldNumber: 1) - } - if self.receivedSize != 0 { - try visitor.visitSingularUInt64Field(value: self.receivedSize, fieldNumber: 2) - } - if self.expectedSize != 0 { - try visitor.visitSingularUInt64Field(value: self.expectedSize, fieldNumber: 3) - } - if self.receivedFiles != 0 { - try visitor.visitSingularUInt64Field(value: self.receivedFiles, fieldNumber: 4) - } - if self.expectedFiles != 0 { - try visitor.visitSingularUInt64Field(value: self.expectedFiles, fieldNumber: 5) - } - if self.totalReceivedSize != 0 { - try visitor.visitSingularUInt64Field(value: self.totalReceivedSize, fieldNumber: 6) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Rsync_ReceiverState, rhs: Rsync_ReceiverState) -> Bool { - if lhs.path != rhs.path {return false} - if lhs.receivedSize != rhs.receivedSize {return false} - if lhs.expectedSize != rhs.expectedSize {return false} - if lhs.receivedFiles != rhs.receivedFiles {return false} - if lhs.expectedFiles != rhs.expectedFiles {return false} - if lhs.totalReceivedSize != rhs.totalReceivedSize {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_scan_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_scan_mode.pb.swift deleted file mode 100644 index 3502a746..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_scan_mode.pb.swift +++ /dev/null @@ -1,106 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_scan_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/scan_mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// ScanMode specifies the mode for synchronization root scanning. -enum Synchronization_ScanMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// ScanMode_ScanModeDefault represents an unspecified scan mode. It should - /// be converted to one of the following values based on the desired default - /// behavior. - case `default` // = 0 - - /// ScanMode_ScanModeFull specifies that full scans should be performed on - /// each synchronization cycle. - case full // = 1 - - /// ScanMode_ScanModeAccelerated specifies that scans should attempt to use - /// watch-based acceleration. - case accelerated // = 2 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .full - case 2: self = .accelerated - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .full: return 1 - case .accelerated: return 2 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Synchronization_ScanMode] = [ - .default, - .full, - .accelerated, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Synchronization_ScanMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "ScanModeDefault"), - 1: .same(proto: "ScanModeFull"), - 2: .same(proto: "ScanModeAccelerated"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_session.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_session.pb.swift deleted file mode 100644 index 24218aa7..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_session.pb.swift +++ /dev/null @@ -1,370 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_session.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/session.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Session represents a synchronization session configuration and persistent -/// state. It is mutable within the context of the daemon, so it should be -/// accessed and modified in a synchronized fashion. Outside of the daemon (e.g. -/// when returned via the API), it should be considered immutable. -struct Synchronization_Session: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Identifier is the (unique) session identifier. It is static. It cannot be - /// empty. - var identifier: String { - get {return _storage._identifier} - set {_uniqueStorage()._identifier = newValue} - } - - /// Version is the session version. It is static. - var version: Synchronization_Version { - get {return _storage._version} - set {_uniqueStorage()._version = newValue} - } - - /// CreationTime is the creation time of the session. It is static. It cannot - /// be nil. - var creationTime: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _storage._creationTime ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_uniqueStorage()._creationTime = newValue} - } - /// Returns true if `creationTime` has been explicitly set. - var hasCreationTime: Bool {return _storage._creationTime != nil} - /// Clears the value of `creationTime`. Subsequent reads from it will return its default value. - mutating func clearCreationTime() {_uniqueStorage()._creationTime = nil} - - /// CreatingVersionMajor is the major version component of the version of - /// Mutagen which created the session. It is static. - var creatingVersionMajor: UInt32 { - get {return _storage._creatingVersionMajor} - set {_uniqueStorage()._creatingVersionMajor = newValue} - } - - /// CreatingVersionMinor is the minor version component of the version of - /// Mutagen which created the session. It is static. - var creatingVersionMinor: UInt32 { - get {return _storage._creatingVersionMinor} - set {_uniqueStorage()._creatingVersionMinor = newValue} - } - - /// CreatingVersionPatch is the patch version component of the version of - /// Mutagen which created the session. It is static. - var creatingVersionPatch: UInt32 { - get {return _storage._creatingVersionPatch} - set {_uniqueStorage()._creatingVersionPatch = newValue} - } - - /// Alpha is the alpha endpoint URL. It is static. It cannot be nil. - var alpha: Url_URL { - get {return _storage._alpha ?? Url_URL()} - set {_uniqueStorage()._alpha = newValue} - } - /// Returns true if `alpha` has been explicitly set. - var hasAlpha: Bool {return _storage._alpha != nil} - /// Clears the value of `alpha`. Subsequent reads from it will return its default value. - mutating func clearAlpha() {_uniqueStorage()._alpha = nil} - - /// Beta is the beta endpoint URL. It is static. It cannot be nil. - var beta: Url_URL { - get {return _storage._beta ?? Url_URL()} - set {_uniqueStorage()._beta = newValue} - } - /// Returns true if `beta` has been explicitly set. - var hasBeta: Bool {return _storage._beta != nil} - /// Clears the value of `beta`. Subsequent reads from it will return its default value. - mutating func clearBeta() {_uniqueStorage()._beta = nil} - - /// Configuration is the flattened session configuration. It is static. It - /// cannot be nil. - var configuration: Synchronization_Configuration { - get {return _storage._configuration ?? Synchronization_Configuration()} - set {_uniqueStorage()._configuration = newValue} - } - /// Returns true if `configuration` has been explicitly set. - var hasConfiguration: Bool {return _storage._configuration != nil} - /// Clears the value of `configuration`. Subsequent reads from it will return its default value. - mutating func clearConfiguration() {_uniqueStorage()._configuration = nil} - - /// ConfigurationAlpha are the alpha-specific session configuration - /// overrides. It is static. It may be nil for existing sessions loaded from - /// disk, but it is not considered valid unless non-nil, so it should be - /// replaced with an empty default value in-memory if a nil on-disk value is - /// detected. - var configurationAlpha: Synchronization_Configuration { - get {return _storage._configurationAlpha ?? Synchronization_Configuration()} - set {_uniqueStorage()._configurationAlpha = newValue} - } - /// Returns true if `configurationAlpha` has been explicitly set. - var hasConfigurationAlpha: Bool {return _storage._configurationAlpha != nil} - /// Clears the value of `configurationAlpha`. Subsequent reads from it will return its default value. - mutating func clearConfigurationAlpha() {_uniqueStorage()._configurationAlpha = nil} - - /// ConfigurationBeta are the beta-specific session configuration overrides. - /// It is static. It may be nil for existing sessions loaded from disk, but - /// it is not considered valid unless non-nil, so it should be replaced with - /// an empty default value in-memory if a nil on-disk value is detected. - var configurationBeta: Synchronization_Configuration { - get {return _storage._configurationBeta ?? Synchronization_Configuration()} - set {_uniqueStorage()._configurationBeta = newValue} - } - /// Returns true if `configurationBeta` has been explicitly set. - var hasConfigurationBeta: Bool {return _storage._configurationBeta != nil} - /// Clears the value of `configurationBeta`. Subsequent reads from it will return its default value. - mutating func clearConfigurationBeta() {_uniqueStorage()._configurationBeta = nil} - - /// Name is a user-friendly name for the session. It may be empty and is not - /// guaranteed to be unique across all sessions. It is only used as a simpler - /// handle for specifying sessions. It is static. - var name: String { - get {return _storage._name} - set {_uniqueStorage()._name = newValue} - } - - /// Labels are the session labels. They are static. - var labels: Dictionary { - get {return _storage._labels} - set {_uniqueStorage()._labels = newValue} - } - - /// Paused indicates whether or not the session is marked as paused. - var paused: Bool { - get {return _storage._paused} - set {_uniqueStorage()._paused = newValue} - } - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "synchronization" - -extension Synchronization_Session: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".Session" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "identifier"), - 2: .same(proto: "version"), - 3: .same(proto: "creationTime"), - 4: .same(proto: "creatingVersionMajor"), - 5: .same(proto: "creatingVersionMinor"), - 6: .same(proto: "creatingVersionPatch"), - 7: .same(proto: "alpha"), - 8: .same(proto: "beta"), - 9: .same(proto: "configuration"), - 11: .same(proto: "configurationAlpha"), - 12: .same(proto: "configurationBeta"), - 14: .same(proto: "name"), - 13: .same(proto: "labels"), - 10: .same(proto: "paused"), - ] - - fileprivate class _StorageClass { - var _identifier: String = String() - var _version: Synchronization_Version = .invalid - var _creationTime: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - var _creatingVersionMajor: UInt32 = 0 - var _creatingVersionMinor: UInt32 = 0 - var _creatingVersionPatch: UInt32 = 0 - var _alpha: Url_URL? = nil - var _beta: Url_URL? = nil - var _configuration: Synchronization_Configuration? = nil - var _configurationAlpha: Synchronization_Configuration? = nil - var _configurationBeta: Synchronization_Configuration? = nil - var _name: String = String() - var _labels: Dictionary = [:] - var _paused: Bool = false - - #if swift(>=5.10) - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - #else - static let defaultInstance = _StorageClass() - #endif - - private init() {} - - init(copying source: _StorageClass) { - _identifier = source._identifier - _version = source._version - _creationTime = source._creationTime - _creatingVersionMajor = source._creatingVersionMajor - _creatingVersionMinor = source._creatingVersionMinor - _creatingVersionPatch = source._creatingVersionPatch - _alpha = source._alpha - _beta = source._beta - _configuration = source._configuration - _configurationAlpha = source._configurationAlpha - _configurationBeta = source._configurationBeta - _name = source._name - _labels = source._labels - _paused = source._paused - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &_storage._identifier) }() - case 2: try { try decoder.decodeSingularEnumField(value: &_storage._version) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._creationTime) }() - case 4: try { try decoder.decodeSingularUInt32Field(value: &_storage._creatingVersionMajor) }() - case 5: try { try decoder.decodeSingularUInt32Field(value: &_storage._creatingVersionMinor) }() - case 6: try { try decoder.decodeSingularUInt32Field(value: &_storage._creatingVersionPatch) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._alpha) }() - case 8: try { try decoder.decodeSingularMessageField(value: &_storage._beta) }() - case 9: try { try decoder.decodeSingularMessageField(value: &_storage._configuration) }() - case 10: try { try decoder.decodeSingularBoolField(value: &_storage._paused) }() - case 11: try { try decoder.decodeSingularMessageField(value: &_storage._configurationAlpha) }() - case 12: try { try decoder.decodeSingularMessageField(value: &_storage._configurationBeta) }() - case 13: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &_storage._labels) }() - case 14: try { try decoder.decodeSingularStringField(value: &_storage._name) }() - default: break - } - } - } - } - - func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !_storage._identifier.isEmpty { - try visitor.visitSingularStringField(value: _storage._identifier, fieldNumber: 1) - } - if _storage._version != .invalid { - try visitor.visitSingularEnumField(value: _storage._version, fieldNumber: 2) - } - try { if let v = _storage._creationTime { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if _storage._creatingVersionMajor != 0 { - try visitor.visitSingularUInt32Field(value: _storage._creatingVersionMajor, fieldNumber: 4) - } - if _storage._creatingVersionMinor != 0 { - try visitor.visitSingularUInt32Field(value: _storage._creatingVersionMinor, fieldNumber: 5) - } - if _storage._creatingVersionPatch != 0 { - try visitor.visitSingularUInt32Field(value: _storage._creatingVersionPatch, fieldNumber: 6) - } - try { if let v = _storage._alpha { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if let v = _storage._beta { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - try { if let v = _storage._configuration { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - if _storage._paused != false { - try visitor.visitSingularBoolField(value: _storage._paused, fieldNumber: 10) - } - try { if let v = _storage._configurationAlpha { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - try { if let v = _storage._configurationBeta { - try visitor.visitSingularMessageField(value: v, fieldNumber: 12) - } }() - if !_storage._labels.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: _storage._labels, fieldNumber: 13) - } - if !_storage._name.isEmpty { - try visitor.visitSingularStringField(value: _storage._name, fieldNumber: 14) - } - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_Session, rhs: Synchronization_Session) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._identifier != rhs_storage._identifier {return false} - if _storage._version != rhs_storage._version {return false} - if _storage._creationTime != rhs_storage._creationTime {return false} - if _storage._creatingVersionMajor != rhs_storage._creatingVersionMajor {return false} - if _storage._creatingVersionMinor != rhs_storage._creatingVersionMinor {return false} - if _storage._creatingVersionPatch != rhs_storage._creatingVersionPatch {return false} - if _storage._alpha != rhs_storage._alpha {return false} - if _storage._beta != rhs_storage._beta {return false} - if _storage._configuration != rhs_storage._configuration {return false} - if _storage._configurationAlpha != rhs_storage._configurationAlpha {return false} - if _storage._configurationBeta != rhs_storage._configurationBeta {return false} - if _storage._name != rhs_storage._name {return false} - if _storage._labels != rhs_storage._labels {return false} - if _storage._paused != rhs_storage._paused {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_stage_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_stage_mode.pb.swift deleted file mode 100644 index b365ab94..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_stage_mode.pb.swift +++ /dev/null @@ -1,115 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_stage_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/stage_mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// StageMode specifies the mode for file staging. -enum Synchronization_StageMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// StageMode_StageModeDefault represents an unspecified staging mode. It - /// should be converted to one of the following values based on the desired - /// default behavior. - case `default` // = 0 - - /// StageMode_StageModeMutagen specifies that files should be staged in the - /// Mutagen data directory. - case mutagen // = 1 - - /// StageMode_StageModeNeighboring specifies that files should be staged in a - /// directory which neighbors the synchronization root. - case neighboring // = 2 - - /// StageMode_StageModeInternal specified that files should be staged in a - /// directory contained within a synchronization root. This mode will only - /// function if the synchronization root already exists. - case `internal` // = 3 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .mutagen - case 2: self = .neighboring - case 3: self = .internal - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .mutagen: return 1 - case .neighboring: return 2 - case .internal: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Synchronization_StageMode] = [ - .default, - .mutagen, - .neighboring, - .internal, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Synchronization_StageMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "StageModeDefault"), - 1: .same(proto: "StageModeMutagen"), - 2: .same(proto: "StageModeNeighboring"), - 3: .same(proto: "StageModeInternal"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_state.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_state.pb.swift deleted file mode 100644 index 25d0d77c..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_state.pb.swift +++ /dev/null @@ -1,579 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_state.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/state.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Status encodes the status of a synchronization session. -enum Synchronization_Status: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// Status_Disconnected indicates that the session is unpaused but not - /// currently connected or connecting to either endpoint. - case disconnected // = 0 - - /// Status_HaltedOnRootEmptied indicates that the session is halted due to - /// the root emptying safety check. - case haltedOnRootEmptied // = 1 - - /// Status_HaltedOnRootDeletion indicates that the session is halted due to - /// the root deletion safety check. - case haltedOnRootDeletion // = 2 - - /// Status_HaltedOnRootTypeChange indicates that the session is halted due to - /// the root type change safety check. - case haltedOnRootTypeChange // = 3 - - /// Status_ConnectingAlpha indicates that the session is attempting to - /// connect to the alpha endpoint. - case connectingAlpha // = 4 - - /// Status_ConnectingBeta indicates that the session is attempting to connect - /// to the beta endpoint. - case connectingBeta // = 5 - - /// Status_Watching indicates that the session is watching for filesystem - /// changes. - case watching // = 6 - - /// Status_Scanning indicates that the session is scanning the filesystem on - /// each endpoint. - case scanning // = 7 - - /// Status_WaitingForRescan indicates that the session is waiting to retry - /// scanning after an error during the previous scanning operation. - case waitingForRescan // = 8 - - /// Status_Reconciling indicates that the session is performing - /// reconciliation. - case reconciling // = 9 - - /// Status_StagingAlpha indicates that the session is staging files on alpha. - case stagingAlpha // = 10 - - /// Status_StagingBeta indicates that the session is staging files on beta. - case stagingBeta // = 11 - - /// Status_Transitioning indicates that the session is performing transition - /// operations on each endpoint. - case transitioning // = 12 - - /// Status_Saving indicates that the session is recording synchronization - /// history to disk. - case saving // = 13 - case UNRECOGNIZED(Int) - - init() { - self = .disconnected - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .disconnected - case 1: self = .haltedOnRootEmptied - case 2: self = .haltedOnRootDeletion - case 3: self = .haltedOnRootTypeChange - case 4: self = .connectingAlpha - case 5: self = .connectingBeta - case 6: self = .watching - case 7: self = .scanning - case 8: self = .waitingForRescan - case 9: self = .reconciling - case 10: self = .stagingAlpha - case 11: self = .stagingBeta - case 12: self = .transitioning - case 13: self = .saving - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .disconnected: return 0 - case .haltedOnRootEmptied: return 1 - case .haltedOnRootDeletion: return 2 - case .haltedOnRootTypeChange: return 3 - case .connectingAlpha: return 4 - case .connectingBeta: return 5 - case .watching: return 6 - case .scanning: return 7 - case .waitingForRescan: return 8 - case .reconciling: return 9 - case .stagingAlpha: return 10 - case .stagingBeta: return 11 - case .transitioning: return 12 - case .saving: return 13 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Synchronization_Status] = [ - .disconnected, - .haltedOnRootEmptied, - .haltedOnRootDeletion, - .haltedOnRootTypeChange, - .connectingAlpha, - .connectingBeta, - .watching, - .scanning, - .waitingForRescan, - .reconciling, - .stagingAlpha, - .stagingBeta, - .transitioning, - .saving, - ] - -} - -/// EndpointState encodes the current state of a synchronization endpoint. It is -/// mutable within the context of the daemon, so it should be accessed and -/// modified in a synchronized fashion. Outside of the daemon (e.g. when returned -/// via the API), it should be considered immutable. -struct Synchronization_EndpointState: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Connected indicates whether or not the controller is currently connected - /// to the endpoint. - var connected: Bool = false - - /// Scanned indicates whether or not at least one scan has been performed on - /// the endpoint. - var scanned: Bool = false - - /// Directories is the number of synchronizable directory entries contained - /// in the last snapshot from the endpoint. - var directories: UInt64 = 0 - - /// Files is the number of synchronizable file entries contained in the last - /// snapshot from the endpoint. - var files: UInt64 = 0 - - /// SymbolicLinks is the number of synchronizable symbolic link entries - /// contained in the last snapshot from the endpoint. - var symbolicLinks: UInt64 = 0 - - /// TotalFileSize is the total size of all synchronizable files referenced by - /// the last snapshot from the endpoint. - var totalFileSize: UInt64 = 0 - - /// ScanProblems is the list of non-terminal problems encountered during the - /// last scanning operation on the endpoint. This list may be a truncated - /// version of the full list if too many problems are encountered to report - /// via the API, in which case ExcludedScanProblems will be non-zero. - var scanProblems: [Core_Problem] = [] - - /// ExcludedScanProblems is the number of problems that have been excluded - /// from ScanProblems due to truncation. This value can be non-zero only if - /// ScanProblems is non-empty. - var excludedScanProblems: UInt64 = 0 - - /// TransitionProblems is the list of non-terminal problems encountered - /// during the last transition operation on the endpoint. This list may be a - /// truncated version of the full list if too many problems are encountered - /// to report via the API, in which case ExcludedTransitionProblems will be - /// non-zero. - var transitionProblems: [Core_Problem] = [] - - /// ExcludedTransitionProblems is the number of problems that have been - /// excluded from TransitionProblems due to truncation. This value can be - /// non-zero only if TransitionProblems is non-empty. - var excludedTransitionProblems: UInt64 = 0 - - /// StagingProgress is the rsync staging progress. It is non-nil if and only - /// if the endpoint is currently staging files. - var stagingProgress: Rsync_ReceiverState { - get {return _stagingProgress ?? Rsync_ReceiverState()} - set {_stagingProgress = newValue} - } - /// Returns true if `stagingProgress` has been explicitly set. - var hasStagingProgress: Bool {return self._stagingProgress != nil} - /// Clears the value of `stagingProgress`. Subsequent reads from it will return its default value. - mutating func clearStagingProgress() {self._stagingProgress = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _stagingProgress: Rsync_ReceiverState? = nil -} - -/// State encodes the current state of a synchronization session. It is mutable -/// within the context of the daemon, so it should be accessed and modified in a -/// synchronized fashion. Outside of the daemon (e.g. when returned via the API), -/// it should be considered immutable. -struct Synchronization_State: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Session is the session metadata. If the session is paused, then the - /// remainder of the fields in this structure should be ignored. - var session: Synchronization_Session { - get {return _storage._session ?? Synchronization_Session()} - set {_uniqueStorage()._session = newValue} - } - /// Returns true if `session` has been explicitly set. - var hasSession: Bool {return _storage._session != nil} - /// Clears the value of `session`. Subsequent reads from it will return its default value. - mutating func clearSession() {_uniqueStorage()._session = nil} - - /// Status is the session status. - var status: Synchronization_Status { - get {return _storage._status} - set {_uniqueStorage()._status = newValue} - } - - /// LastError is the last error to occur during synchronization. It is - /// cleared after a successful synchronization cycle. - var lastError: String { - get {return _storage._lastError} - set {_uniqueStorage()._lastError = newValue} - } - - /// SuccessfulCycles is the number of successful synchronization cycles to - /// occur since successfully connecting to the endpoints. - var successfulCycles: UInt64 { - get {return _storage._successfulCycles} - set {_uniqueStorage()._successfulCycles = newValue} - } - - /// Conflicts are the content conflicts identified during reconciliation. - /// This list may be a truncated version of the full list if too many - /// conflicts are encountered to report via the API, in which case - /// ExcludedConflicts will be non-zero. - var conflicts: [Core_Conflict] { - get {return _storage._conflicts} - set {_uniqueStorage()._conflicts = newValue} - } - - /// ExcludedConflicts is the number of conflicts that have been excluded from - /// Conflicts due to truncation. This value can be non-zero only if conflicts - /// is non-empty. - var excludedConflicts: UInt64 { - get {return _storage._excludedConflicts} - set {_uniqueStorage()._excludedConflicts = newValue} - } - - /// AlphaState encodes the state of the alpha endpoint. It is always non-nil. - var alphaState: Synchronization_EndpointState { - get {return _storage._alphaState ?? Synchronization_EndpointState()} - set {_uniqueStorage()._alphaState = newValue} - } - /// Returns true if `alphaState` has been explicitly set. - var hasAlphaState: Bool {return _storage._alphaState != nil} - /// Clears the value of `alphaState`. Subsequent reads from it will return its default value. - mutating func clearAlphaState() {_uniqueStorage()._alphaState = nil} - - /// BetaState encodes the state of the beta endpoint. It is always non-nil. - var betaState: Synchronization_EndpointState { - get {return _storage._betaState ?? Synchronization_EndpointState()} - set {_uniqueStorage()._betaState = newValue} - } - /// Returns true if `betaState` has been explicitly set. - var hasBetaState: Bool {return _storage._betaState != nil} - /// Clears the value of `betaState`. Subsequent reads from it will return its default value. - mutating func clearBetaState() {_uniqueStorage()._betaState = nil} - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "synchronization" - -extension Synchronization_Status: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "Disconnected"), - 1: .same(proto: "HaltedOnRootEmptied"), - 2: .same(proto: "HaltedOnRootDeletion"), - 3: .same(proto: "HaltedOnRootTypeChange"), - 4: .same(proto: "ConnectingAlpha"), - 5: .same(proto: "ConnectingBeta"), - 6: .same(proto: "Watching"), - 7: .same(proto: "Scanning"), - 8: .same(proto: "WaitingForRescan"), - 9: .same(proto: "Reconciling"), - 10: .same(proto: "StagingAlpha"), - 11: .same(proto: "StagingBeta"), - 12: .same(proto: "Transitioning"), - 13: .same(proto: "Saving"), - ] -} - -extension Synchronization_EndpointState: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".EndpointState" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "connected"), - 2: .same(proto: "scanned"), - 3: .same(proto: "directories"), - 4: .same(proto: "files"), - 5: .same(proto: "symbolicLinks"), - 6: .same(proto: "totalFileSize"), - 7: .same(proto: "scanProblems"), - 8: .same(proto: "excludedScanProblems"), - 9: .same(proto: "transitionProblems"), - 10: .same(proto: "excludedTransitionProblems"), - 11: .same(proto: "stagingProgress"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.connected) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.scanned) }() - case 3: try { try decoder.decodeSingularUInt64Field(value: &self.directories) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &self.files) }() - case 5: try { try decoder.decodeSingularUInt64Field(value: &self.symbolicLinks) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &self.totalFileSize) }() - case 7: try { try decoder.decodeRepeatedMessageField(value: &self.scanProblems) }() - case 8: try { try decoder.decodeSingularUInt64Field(value: &self.excludedScanProblems) }() - case 9: try { try decoder.decodeRepeatedMessageField(value: &self.transitionProblems) }() - case 10: try { try decoder.decodeSingularUInt64Field(value: &self.excludedTransitionProblems) }() - case 11: try { try decoder.decodeSingularMessageField(value: &self._stagingProgress) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.connected != false { - try visitor.visitSingularBoolField(value: self.connected, fieldNumber: 1) - } - if self.scanned != false { - try visitor.visitSingularBoolField(value: self.scanned, fieldNumber: 2) - } - if self.directories != 0 { - try visitor.visitSingularUInt64Field(value: self.directories, fieldNumber: 3) - } - if self.files != 0 { - try visitor.visitSingularUInt64Field(value: self.files, fieldNumber: 4) - } - if self.symbolicLinks != 0 { - try visitor.visitSingularUInt64Field(value: self.symbolicLinks, fieldNumber: 5) - } - if self.totalFileSize != 0 { - try visitor.visitSingularUInt64Field(value: self.totalFileSize, fieldNumber: 6) - } - if !self.scanProblems.isEmpty { - try visitor.visitRepeatedMessageField(value: self.scanProblems, fieldNumber: 7) - } - if self.excludedScanProblems != 0 { - try visitor.visitSingularUInt64Field(value: self.excludedScanProblems, fieldNumber: 8) - } - if !self.transitionProblems.isEmpty { - try visitor.visitRepeatedMessageField(value: self.transitionProblems, fieldNumber: 9) - } - if self.excludedTransitionProblems != 0 { - try visitor.visitSingularUInt64Field(value: self.excludedTransitionProblems, fieldNumber: 10) - } - try { if let v = self._stagingProgress { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_EndpointState, rhs: Synchronization_EndpointState) -> Bool { - if lhs.connected != rhs.connected {return false} - if lhs.scanned != rhs.scanned {return false} - if lhs.directories != rhs.directories {return false} - if lhs.files != rhs.files {return false} - if lhs.symbolicLinks != rhs.symbolicLinks {return false} - if lhs.totalFileSize != rhs.totalFileSize {return false} - if lhs.scanProblems != rhs.scanProblems {return false} - if lhs.excludedScanProblems != rhs.excludedScanProblems {return false} - if lhs.transitionProblems != rhs.transitionProblems {return false} - if lhs.excludedTransitionProblems != rhs.excludedTransitionProblems {return false} - if lhs._stagingProgress != rhs._stagingProgress {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Synchronization_State: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".State" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "session"), - 2: .same(proto: "status"), - 3: .same(proto: "lastError"), - 4: .same(proto: "successfulCycles"), - 5: .same(proto: "conflicts"), - 6: .same(proto: "excludedConflicts"), - 7: .same(proto: "alphaState"), - 8: .same(proto: "betaState"), - ] - - fileprivate class _StorageClass { - var _session: Synchronization_Session? = nil - var _status: Synchronization_Status = .disconnected - var _lastError: String = String() - var _successfulCycles: UInt64 = 0 - var _conflicts: [Core_Conflict] = [] - var _excludedConflicts: UInt64 = 0 - var _alphaState: Synchronization_EndpointState? = nil - var _betaState: Synchronization_EndpointState? = nil - - #if swift(>=5.10) - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - #else - static let defaultInstance = _StorageClass() - #endif - - private init() {} - - init(copying source: _StorageClass) { - _session = source._session - _status = source._status - _lastError = source._lastError - _successfulCycles = source._successfulCycles - _conflicts = source._conflicts - _excludedConflicts = source._excludedConflicts - _alphaState = source._alphaState - _betaState = source._betaState - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &_storage._session) }() - case 2: try { try decoder.decodeSingularEnumField(value: &_storage._status) }() - case 3: try { try decoder.decodeSingularStringField(value: &_storage._lastError) }() - case 4: try { try decoder.decodeSingularUInt64Field(value: &_storage._successfulCycles) }() - case 5: try { try decoder.decodeRepeatedMessageField(value: &_storage._conflicts) }() - case 6: try { try decoder.decodeSingularUInt64Field(value: &_storage._excludedConflicts) }() - case 7: try { try decoder.decodeSingularMessageField(value: &_storage._alphaState) }() - case 8: try { try decoder.decodeSingularMessageField(value: &_storage._betaState) }() - default: break - } - } - } - } - - func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = _storage._session { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if _storage._status != .disconnected { - try visitor.visitSingularEnumField(value: _storage._status, fieldNumber: 2) - } - if !_storage._lastError.isEmpty { - try visitor.visitSingularStringField(value: _storage._lastError, fieldNumber: 3) - } - if _storage._successfulCycles != 0 { - try visitor.visitSingularUInt64Field(value: _storage._successfulCycles, fieldNumber: 4) - } - if !_storage._conflicts.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._conflicts, fieldNumber: 5) - } - if _storage._excludedConflicts != 0 { - try visitor.visitSingularUInt64Field(value: _storage._excludedConflicts, fieldNumber: 6) - } - try { if let v = _storage._alphaState { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if let v = _storage._betaState { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Synchronization_State, rhs: Synchronization_State) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._session != rhs_storage._session {return false} - if _storage._status != rhs_storage._status {return false} - if _storage._lastError != rhs_storage._lastError {return false} - if _storage._successfulCycles != rhs_storage._successfulCycles {return false} - if _storage._conflicts != rhs_storage._conflicts {return false} - if _storage._excludedConflicts != rhs_storage._excludedConflicts {return false} - if _storage._alphaState != rhs_storage._alphaState {return false} - if _storage._betaState != rhs_storage._betaState {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_version.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_version.pb.swift deleted file mode 100644 index c50d984b..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_version.pb.swift +++ /dev/null @@ -1,98 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_version.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/version.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Version specifies a session version, providing default behavior that can vary -/// without affecting existing sessions. -enum Synchronization_Version: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// Invalid is the default session version and represents an unspecfied and - /// invalid version. It is used as a sanity check to ensure that version is - /// set for a session. - case invalid // = 0 - - /// Version1 represents session version 1. - case version1 // = 1 - case UNRECOGNIZED(Int) - - init() { - self = .invalid - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .invalid - case 1: self = .version1 - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .invalid: return 0 - case .version1: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Synchronization_Version] = [ - .invalid, - .version1, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Synchronization_Version: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "Invalid"), - 1: .same(proto: "Version1"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_watch_mode.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_watch_mode.pb.swift deleted file mode 100644 index 4f5e3aef..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_watch_mode.pb.swift +++ /dev/null @@ -1,118 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: synchronization_watch_mode.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/synchronization/watch_mode.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// WatchMode specifies the mode for filesystem watching. -enum Synchronization_WatchMode: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// WatchMode_WatchModeDefault represents an unspecified watch mode. It - /// should be converted to one of the following values based on the desired - /// default behavior. - case `default` // = 0 - - /// WatchMode_WatchModePortable specifies that native recursive watching - /// should be used to monitor paths on systems that support it if those paths - /// fall under the home directory. In these cases, a watch on the entire home - /// directory is established and filtered for events pertaining to the - /// specified path. On all other systems and for all other paths, poll-based - /// watching is used. - case portable // = 1 - - /// WatchMode_WatchModeForcePoll specifies that only poll-based watching - /// should be used. - case forcePoll // = 2 - - /// WatchMode_WatchModeNoWatch specifies that no watching should be used - /// (i.e. no events should be generated). - case noWatch // = 3 - case UNRECOGNIZED(Int) - - init() { - self = .default - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .default - case 1: self = .portable - case 2: self = .forcePoll - case 3: self = .noWatch - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .default: return 0 - case .portable: return 1 - case .forcePoll: return 2 - case .noWatch: return 3 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Synchronization_WatchMode] = [ - .default, - .portable, - .forcePoll, - .noWatch, - ] - -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -extension Synchronization_WatchMode: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "WatchModeDefault"), - 1: .same(proto: "WatchModePortable"), - 2: .same(proto: "WatchModeForcePoll"), - 3: .same(proto: "WatchModeNoWatch"), - ] -} diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/url_url.pb.swift b/Coder-Desktop/VPNLib/FileSync/MutagenSDK/url_url.pb.swift deleted file mode 100644 index a7893494..00000000 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/url_url.pb.swift +++ /dev/null @@ -1,266 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: url_url.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -// -// This file was taken from -// https://github.com/coder/mutagen/tree/v0.18.3/pkg/url/url.proto -// -// MIT License -// -// Copyright (c) 2016-present Docker, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// Kind indicates the kind of a URL. -enum Url_Kind: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// Synchronization indicates a synchronization URL. - case synchronization // = 0 - - /// Forwarding indicates a forwarding URL. - case forwarding // = 1 - case UNRECOGNIZED(Int) - - init() { - self = .synchronization - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .synchronization - case 1: self = .forwarding - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .synchronization: return 0 - case .forwarding: return 1 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Url_Kind] = [ - .synchronization, - .forwarding, - ] - -} - -/// Protocol indicates a location type. -enum Url_Protocol: SwiftProtobuf.Enum, Swift.CaseIterable { - typealias RawValue = Int - - /// Local indicates that the resource is on the local system. - case local // = 0 - - /// SSH indicates that the resource is accessible via SSH. - case ssh // = 1 - - /// Docker indicates that the resource is inside a Docker container. - case docker // = 11 - case UNRECOGNIZED(Int) - - init() { - self = .local - } - - init?(rawValue: Int) { - switch rawValue { - case 0: self = .local - case 1: self = .ssh - case 11: self = .docker - default: self = .UNRECOGNIZED(rawValue) - } - } - - var rawValue: Int { - switch self { - case .local: return 0 - case .ssh: return 1 - case .docker: return 11 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - static let allCases: [Url_Protocol] = [ - .local, - .ssh, - .docker, - ] - -} - -/// URL represents a pointer to a resource. It should be considered immutable. -struct Url_URL: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// Kind indicates the URL kind. - /// NOTE: This field number is out of order for historical reasons. - var kind: Url_Kind = .synchronization - - /// Protocol indicates a location type. - var `protocol`: Url_Protocol = .local - - /// User is the user under which a resource should be accessed. - var user: String = String() - - /// Host is protocol-specific, but generally indicates the location of the - /// remote. - var host: String = String() - - /// Port indicates a TCP port via which to access the remote location, if - /// applicable. - var port: UInt32 = 0 - - /// Path indicates the path of a resource. - var path: String = String() - - /// Environment contains captured environment variable information. It is not - /// a required component and its contents and their behavior depend on the - /// transport implementation. - var environment: Dictionary = [:] - - /// Parameters are internal transport parameters. These are set for URLs - /// generated internally that require additional metadata. Parameters are not - /// required and their behavior is dependent on the transport implementation. - var parameters: Dictionary = [:] - - var unknownFields = SwiftProtobuf.UnknownStorage() - - init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "url" - -extension Url_Kind: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "Synchronization"), - 1: .same(proto: "Forwarding"), - ] -} - -extension Url_Protocol: SwiftProtobuf._ProtoNameProviding { - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "Local"), - 1: .same(proto: "SSH"), - 11: .same(proto: "Docker"), - ] -} - -extension Url_URL: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - static let protoMessageName: String = _protobuf_package + ".URL" - static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 7: .same(proto: "kind"), - 1: .same(proto: "protocol"), - 2: .same(proto: "user"), - 3: .same(proto: "host"), - 4: .same(proto: "port"), - 5: .same(proto: "path"), - 6: .same(proto: "environment"), - 8: .same(proto: "parameters"), - ] - - mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.`protocol`) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.user) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.host) }() - case 4: try { try decoder.decodeSingularUInt32Field(value: &self.port) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.path) }() - case 6: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.environment) }() - case 7: try { try decoder.decodeSingularEnumField(value: &self.kind) }() - case 8: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: &self.parameters) }() - default: break - } - } - } - - func traverse(visitor: inout V) throws { - if self.`protocol` != .local { - try visitor.visitSingularEnumField(value: self.`protocol`, fieldNumber: 1) - } - if !self.user.isEmpty { - try visitor.visitSingularStringField(value: self.user, fieldNumber: 2) - } - if !self.host.isEmpty { - try visitor.visitSingularStringField(value: self.host, fieldNumber: 3) - } - if self.port != 0 { - try visitor.visitSingularUInt32Field(value: self.port, fieldNumber: 4) - } - if !self.path.isEmpty { - try visitor.visitSingularStringField(value: self.path, fieldNumber: 5) - } - if !self.environment.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.environment, fieldNumber: 6) - } - if self.kind != .synchronization { - try visitor.visitSingularEnumField(value: self.kind, fieldNumber: 7) - } - if !self.parameters.isEmpty { - try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMap.self, value: self.parameters, fieldNumber: 8) - } - try unknownFields.traverse(visitor: &visitor) - } - - static func ==(lhs: Url_URL, rhs: Url_URL) -> Bool { - if lhs.kind != rhs.kind {return false} - if lhs.`protocol` != rhs.`protocol` {return false} - if lhs.user != rhs.user {return false} - if lhs.host != rhs.host {return false} - if lhs.port != rhs.port {return false} - if lhs.path != rhs.path {return false} - if lhs.environment != rhs.environment {return false} - if lhs.parameters != rhs.parameters {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/VPNLib/grpc-swift-proto-generator-config.json b/Coder-Desktop/VPNLib/grpc-swift-proto-generator-config.json new file mode 100644 index 00000000..d3cac9e0 --- /dev/null +++ b/Coder-Desktop/VPNLib/grpc-swift-proto-generator-config.json @@ -0,0 +1,10 @@ +{ + "generate": { + "clients": false, + "servers": false, + "messages": true + }, + "generatedSource": { + "accessLevel": "public" + } +} diff --git a/Coder-Desktop/VPNLib/vpn.pb.swift b/Coder-Desktop/VPNLib/vpn.pb.swift deleted file mode 100644 index 6e56a3ad..00000000 --- a/Coder-Desktop/VPNLib/vpn.pb.swift +++ /dev/null @@ -1,2545 +0,0 @@ -// DO NOT EDIT. -// swift-format-ignore-file -// swiftlint:disable all -// -// Generated by the Swift generator plugin for the protocol buffer compiler. -// Source: Coder-Desktop/VPNLib/vpn.proto -// -// For information on using the generated types, please see the documentation: -// https://github.com/apple/swift-protobuf/ - -import Foundation -import SwiftProtobuf - -// If the compiler emits an error on this type, it is because this file -// was generated by a version of the `protoc` Swift plug-in that is -// incompatible with the version of SwiftProtobuf to which you are linking. -// Please ensure that you are building against the same version of the API -// that was used to generate this file. -fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { - struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} - typealias Version = _2 -} - -/// RPC allows a very simple unary request/response RPC mechanism. The requester generates a unique -/// msg_id which it sets on the request, the responder sets response_to that msg_id on the response -/// message -public struct Vpn_RPC: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var msgID: UInt64 = 0 - - public var responseTo: UInt64 = 0 - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// ManagerMessage is a message from the manager (to the tunnel). -public struct Vpn_ManagerMessage: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rpc: Vpn_RPC { - get {return _rpc ?? Vpn_RPC()} - set {_rpc = newValue} - } - /// Returns true if `rpc` has been explicitly set. - public var hasRpc: Bool {return self._rpc != nil} - /// Clears the value of `rpc`. Subsequent reads from it will return its default value. - public mutating func clearRpc() {self._rpc = nil} - - public var msg: Vpn_ManagerMessage.OneOf_Msg? = nil - - public var getPeerUpdate: Vpn_GetPeerUpdate { - get { - if case .getPeerUpdate(let v)? = msg {return v} - return Vpn_GetPeerUpdate() - } - set {msg = .getPeerUpdate(newValue)} - } - - public var networkSettings: Vpn_NetworkSettingsResponse { - get { - if case .networkSettings(let v)? = msg {return v} - return Vpn_NetworkSettingsResponse() - } - set {msg = .networkSettings(newValue)} - } - - public var start: Vpn_StartRequest { - get { - if case .start(let v)? = msg {return v} - return Vpn_StartRequest() - } - set {msg = .start(newValue)} - } - - public var stop: Vpn_StopRequest { - get { - if case .stop(let v)? = msg {return v} - return Vpn_StopRequest() - } - set {msg = .stop(newValue)} - } - - public var wake: Vpn_WakeRequest { - get { - if case .wake(let v)? = msg {return v} - return Vpn_WakeRequest() - } - set {msg = .wake(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Msg: Equatable, Sendable { - case getPeerUpdate(Vpn_GetPeerUpdate) - case networkSettings(Vpn_NetworkSettingsResponse) - case start(Vpn_StartRequest) - case stop(Vpn_StopRequest) - case wake(Vpn_WakeRequest) - - } - - public init() {} - - fileprivate var _rpc: Vpn_RPC? = nil -} - -/// TunnelMessage is a message from the tunnel (to the manager). -public struct Vpn_TunnelMessage: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rpc: Vpn_RPC { - get {return _rpc ?? Vpn_RPC()} - set {_rpc = newValue} - } - /// Returns true if `rpc` has been explicitly set. - public var hasRpc: Bool {return self._rpc != nil} - /// Clears the value of `rpc`. Subsequent reads from it will return its default value. - public mutating func clearRpc() {self._rpc = nil} - - public var msg: Vpn_TunnelMessage.OneOf_Msg? = nil - - public var log: Vpn_Log { - get { - if case .log(let v)? = msg {return v} - return Vpn_Log() - } - set {msg = .log(newValue)} - } - - public var peerUpdate: Vpn_PeerUpdate { - get { - if case .peerUpdate(let v)? = msg {return v} - return Vpn_PeerUpdate() - } - set {msg = .peerUpdate(newValue)} - } - - public var networkSettings: Vpn_NetworkSettingsRequest { - get { - if case .networkSettings(let v)? = msg {return v} - return Vpn_NetworkSettingsRequest() - } - set {msg = .networkSettings(newValue)} - } - - public var start: Vpn_StartResponse { - get { - if case .start(let v)? = msg {return v} - return Vpn_StartResponse() - } - set {msg = .start(newValue)} - } - - public var stop: Vpn_StopResponse { - get { - if case .stop(let v)? = msg {return v} - return Vpn_StopResponse() - } - set {msg = .stop(newValue)} - } - - public var wake: Vpn_WakeResponse { - get { - if case .wake(let v)? = msg {return v} - return Vpn_WakeResponse() - } - set {msg = .wake(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Msg: Equatable, Sendable { - case log(Vpn_Log) - case peerUpdate(Vpn_PeerUpdate) - case networkSettings(Vpn_NetworkSettingsRequest) - case start(Vpn_StartResponse) - case stop(Vpn_StopResponse) - case wake(Vpn_WakeResponse) - - } - - public init() {} - - fileprivate var _rpc: Vpn_RPC? = nil -} - -/// ClientMessage is a message from the client (to the service). Windows only. -public struct Vpn_ClientMessage: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rpc: Vpn_RPC { - get {return _rpc ?? Vpn_RPC()} - set {_rpc = newValue} - } - /// Returns true if `rpc` has been explicitly set. - public var hasRpc: Bool {return self._rpc != nil} - /// Clears the value of `rpc`. Subsequent reads from it will return its default value. - public mutating func clearRpc() {self._rpc = nil} - - public var msg: Vpn_ClientMessage.OneOf_Msg? = nil - - public var start: Vpn_StartRequest { - get { - if case .start(let v)? = msg {return v} - return Vpn_StartRequest() - } - set {msg = .start(newValue)} - } - - public var stop: Vpn_StopRequest { - get { - if case .stop(let v)? = msg {return v} - return Vpn_StopRequest() - } - set {msg = .stop(newValue)} - } - - public var status: Vpn_StatusRequest { - get { - if case .status(let v)? = msg {return v} - return Vpn_StatusRequest() - } - set {msg = .status(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Msg: Equatable, Sendable { - case start(Vpn_StartRequest) - case stop(Vpn_StopRequest) - case status(Vpn_StatusRequest) - - } - - public init() {} - - fileprivate var _rpc: Vpn_RPC? = nil -} - -/// ServiceMessage is a message from the service (to the client). Windows only. -public struct Vpn_ServiceMessage: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var rpc: Vpn_RPC { - get {return _rpc ?? Vpn_RPC()} - set {_rpc = newValue} - } - /// Returns true if `rpc` has been explicitly set. - public var hasRpc: Bool {return self._rpc != nil} - /// Clears the value of `rpc`. Subsequent reads from it will return its default value. - public mutating func clearRpc() {self._rpc = nil} - - public var msg: Vpn_ServiceMessage.OneOf_Msg? = nil - - public var start: Vpn_StartResponse { - get { - if case .start(let v)? = msg {return v} - return Vpn_StartResponse() - } - set {msg = .start(newValue)} - } - - public var stop: Vpn_StopResponse { - get { - if case .stop(let v)? = msg {return v} - return Vpn_StopResponse() - } - set {msg = .stop(newValue)} - } - - /// either in reply to a StatusRequest or broadcasted - public var status: Vpn_Status { - get { - if case .status(let v)? = msg {return v} - return Vpn_Status() - } - set {msg = .status(newValue)} - } - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum OneOf_Msg: Equatable, Sendable { - case start(Vpn_StartResponse) - case stop(Vpn_StopResponse) - /// either in reply to a StatusRequest or broadcasted - case status(Vpn_Status) - - } - - public init() {} - - fileprivate var _rpc: Vpn_RPC? = nil -} - -/// Log is a log message generated by the tunnel. The manager should log it to the system log. It is -/// one-way tunnel -> manager with no response. -public struct Vpn_Log: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var level: Vpn_Log.Level = .debug - - public var message: String = String() - - public var loggerNames: [String] = [] - - public var fields: [Vpn_Log.Field] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Level: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - - /// these are designed to match slog levels - case debug // = 0 - case info // = 1 - case warn // = 2 - case error // = 3 - case critical // = 4 - case fatal // = 5 - case UNRECOGNIZED(Int) - - public init() { - self = .debug - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .debug - case 1: self = .info - case 2: self = .warn - case 3: self = .error - case 4: self = .critical - case 5: self = .fatal - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .debug: return 0 - case .info: return 1 - case .warn: return 2 - case .error: return 3 - case .critical: return 4 - case .fatal: return 5 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Vpn_Log.Level] = [ - .debug, - .info, - .warn, - .error, - .critical, - .fatal, - ] - - } - - public struct Field: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -/// GetPeerUpdate asks for a PeerUpdate with a full set of data. -public struct Vpn_GetPeerUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// PeerUpdate is an update about workspaces and agents connected via the tunnel. It is generated in -/// response to GetPeerUpdate (which dumps the full set). It is also generated on any changes (not in -/// response to any request). -public struct Vpn_PeerUpdate: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var upsertedWorkspaces: [Vpn_Workspace] = [] - - public var upsertedAgents: [Vpn_Agent] = [] - - public var deletedWorkspaces: [Vpn_Workspace] = [] - - public var deletedAgents: [Vpn_Agent] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Vpn_Workspace: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// UUID - public var id: Data = Data() - - public var name: String = String() - - public var status: Vpn_Workspace.Status = .unknown - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Status: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case pending // = 1 - case starting // = 2 - case running // = 3 - case stopping // = 4 - case stopped // = 5 - case failed // = 6 - case canceling // = 7 - case canceled // = 8 - case deleting // = 9 - case deleted // = 10 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .pending - case 2: self = .starting - case 3: self = .running - case 4: self = .stopping - case 5: self = .stopped - case 6: self = .failed - case 7: self = .canceling - case 8: self = .canceled - case 9: self = .deleting - case 10: self = .deleted - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .pending: return 1 - case .starting: return 2 - case .running: return 3 - case .stopping: return 4 - case .stopped: return 5 - case .failed: return 6 - case .canceling: return 7 - case .canceled: return 8 - case .deleting: return 9 - case .deleted: return 10 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Vpn_Workspace.Status] = [ - .unknown, - .pending, - .starting, - .running, - .stopping, - .stopped, - .failed, - .canceling, - .canceled, - .deleting, - .deleted, - ] - - } - - public init() {} -} - -public struct Vpn_Agent: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// UUID - public var id: Data = Data() - - public var name: String = String() - - /// UUID - public var workspaceID: Data = Data() - - public var fqdn: [String] = [] - - public var ipAddrs: [String] = [] - - /// last_handshake is the primary indicator of whether we are connected to a peer. Zero value or - /// anything longer than 5 minutes ago means there is a problem. - public var lastHandshake: SwiftProtobuf.Google_Protobuf_Timestamp { - get {return _lastHandshake ?? SwiftProtobuf.Google_Protobuf_Timestamp()} - set {_lastHandshake = newValue} - } - /// Returns true if `lastHandshake` has been explicitly set. - public var hasLastHandshake: Bool {return self._lastHandshake != nil} - /// Clears the value of `lastHandshake`. Subsequent reads from it will return its default value. - public mutating func clearLastHandshake() {self._lastHandshake = nil} - - /// If unset, a successful ping has not yet been made. - public var lastPing: Vpn_LastPing { - get {return _lastPing ?? Vpn_LastPing()} - set {_lastPing = newValue} - } - /// Returns true if `lastPing` has been explicitly set. - public var hasLastPing: Bool {return self._lastPing != nil} - /// Clears the value of `lastPing`. Subsequent reads from it will return its default value. - public mutating func clearLastPing() {self._lastPing = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _lastHandshake: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _lastPing: Vpn_LastPing? = nil -} - -public struct Vpn_LastPing: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - /// latency is the RTT of the ping to the agent. - public var latency: SwiftProtobuf.Google_Protobuf_Duration { - get {return _latency ?? SwiftProtobuf.Google_Protobuf_Duration()} - set {_latency = newValue} - } - /// Returns true if `latency` has been explicitly set. - public var hasLatency: Bool {return self._latency != nil} - /// Clears the value of `latency`. Subsequent reads from it will return its default value. - public mutating func clearLatency() {self._latency = nil} - - /// did_p2p indicates whether the ping was sent P2P, or over DERP. - public var didP2P: Bool = false - - /// preferred_derp is the human readable name of the preferred DERP region, - /// or the region used for the last ping, if it was sent over DERP. - public var preferredDerp: String = String() - - /// preferred_derp_latency is the last known latency to the preferred DERP - /// region. Unset if the region does not appear in the DERP map. - public var preferredDerpLatency: SwiftProtobuf.Google_Protobuf_Duration { - get {return _preferredDerpLatency ?? SwiftProtobuf.Google_Protobuf_Duration()} - set {_preferredDerpLatency = newValue} - } - /// Returns true if `preferredDerpLatency` has been explicitly set. - public var hasPreferredDerpLatency: Bool {return self._preferredDerpLatency != nil} - /// Clears the value of `preferredDerpLatency`. Subsequent reads from it will return its default value. - public mutating func clearPreferredDerpLatency() {self._preferredDerpLatency = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - - fileprivate var _latency: SwiftProtobuf.Google_Protobuf_Duration? = nil - fileprivate var _preferredDerpLatency: SwiftProtobuf.Google_Protobuf_Duration? = nil -} - -/// NetworkSettingsRequest is based on -/// https://developer.apple.com/documentation/networkextension/nepackettunnelnetworksettings for -/// macOS. It is a request/response message with response NetworkSettingsResponse -public struct Vpn_NetworkSettingsRequest: @unchecked Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var tunnelOverheadBytes: UInt32 { - get {return _storage._tunnelOverheadBytes} - set {_uniqueStorage()._tunnelOverheadBytes = newValue} - } - - public var mtu: UInt32 { - get {return _storage._mtu} - set {_uniqueStorage()._mtu = newValue} - } - - public var dnsSettings: Vpn_NetworkSettingsRequest.DNSSettings { - get {return _storage._dnsSettings ?? Vpn_NetworkSettingsRequest.DNSSettings()} - set {_uniqueStorage()._dnsSettings = newValue} - } - /// Returns true if `dnsSettings` has been explicitly set. - public var hasDnsSettings: Bool {return _storage._dnsSettings != nil} - /// Clears the value of `dnsSettings`. Subsequent reads from it will return its default value. - public mutating func clearDnsSettings() {_uniqueStorage()._dnsSettings = nil} - - public var tunnelRemoteAddress: String { - get {return _storage._tunnelRemoteAddress} - set {_uniqueStorage()._tunnelRemoteAddress = newValue} - } - - public var ipv4Settings: Vpn_NetworkSettingsRequest.IPv4Settings { - get {return _storage._ipv4Settings ?? Vpn_NetworkSettingsRequest.IPv4Settings()} - set {_uniqueStorage()._ipv4Settings = newValue} - } - /// Returns true if `ipv4Settings` has been explicitly set. - public var hasIpv4Settings: Bool {return _storage._ipv4Settings != nil} - /// Clears the value of `ipv4Settings`. Subsequent reads from it will return its default value. - public mutating func clearIpv4Settings() {_uniqueStorage()._ipv4Settings = nil} - - public var ipv6Settings: Vpn_NetworkSettingsRequest.IPv6Settings { - get {return _storage._ipv6Settings ?? Vpn_NetworkSettingsRequest.IPv6Settings()} - set {_uniqueStorage()._ipv6Settings = newValue} - } - /// Returns true if `ipv6Settings` has been explicitly set. - public var hasIpv6Settings: Bool {return _storage._ipv6Settings != nil} - /// Clears the value of `ipv6Settings`. Subsequent reads from it will return its default value. - public mutating func clearIpv6Settings() {_uniqueStorage()._ipv6Settings = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct DNSSettings: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var servers: [String] = [] - - public var searchDomains: [String] = [] - - /// domain_name is the primary domain name of the tunnel - public var domainName: String = String() - - public var matchDomains: [String] = [] - - /// match_domains_no_search specifies if the domains in the matchDomains list should not be - /// appended to the resolver’s list of search domains. - public var matchDomainsNoSearch: Bool = false - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public struct IPv4Settings: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var addrs: [String] = [] - - public var subnetMasks: [String] = [] - - /// router is the next-hop router in dotted-decimal format - public var router: String = String() - - public var includedRoutes: [Vpn_NetworkSettingsRequest.IPv4Settings.IPv4Route] = [] - - public var excludedRoutes: [Vpn_NetworkSettingsRequest.IPv4Settings.IPv4Route] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct IPv4Route: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var destination: String = String() - - public var mask: String = String() - - /// router is the next-hop router in dotted-decimal format - public var router: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} - } - - public struct IPv6Settings: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var addrs: [String] = [] - - public var prefixLengths: [UInt32] = [] - - public var includedRoutes: [Vpn_NetworkSettingsRequest.IPv6Settings.IPv6Route] = [] - - public var excludedRoutes: [Vpn_NetworkSettingsRequest.IPv6Settings.IPv6Route] = [] - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public struct IPv6Route: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var destination: String = String() - - public var prefixLength: UInt32 = 0 - - /// router is the address of the next-hop - public var router: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} - } - - public init() {} - - fileprivate var _storage = _StorageClass.defaultInstance -} - -/// NetworkSettingsResponse is the response from the manager to the tunnel for a -/// NetworkSettingsRequest -public struct Vpn_NetworkSettingsResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var success: Bool = false - - public var errorMessage: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// StartRequest is a request from the manager to start the tunnel. The tunnel replies with a -/// StartResponse. -public struct Vpn_StartRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var tunnelFileDescriptor: Int32 = 0 - - public var coderURL: String = String() - - public var apiToken: String = String() - - public var headers: [Vpn_StartRequest.Header] = [] - - /// Device ID from Coder Desktop - public var deviceID: String = String() - - /// Device OS from Coder Desktop - public var deviceOs: String = String() - - /// Coder Desktop version - public var coderDesktopVersion: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - /// Additional HTTP headers added to all requests - public struct Header: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var name: String = String() - - public var value: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} - } - - public init() {} -} - -public struct Vpn_StartResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var success: Bool = false - - public var errorMessage: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// StopRequest is a request from the manager to stop the tunnel. The tunnel replies with a -/// StopResponse. -public struct Vpn_StopRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// StopResponse is a response to stopping the tunnel. After sending this response, the tunnel closes -/// its side of the bidirectional stream for writing. -public struct Vpn_StopResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var success: Bool = false - - public var errorMessage: String = String() - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// StatusRequest is a request to get the status of the tunnel. The manager -/// replies with a Status. -public struct Vpn_StatusRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -/// Status is sent in response to a StatusRequest or broadcasted to all clients -/// when the status changes. -public struct Vpn_Status: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var lifecycle: Vpn_Status.Lifecycle = .unknown - - public var errorMessage: String = String() - - /// This will be a FULL update with all workspaces and agents, so clients - /// should replace their current peer state. Only the Upserted fields will - /// be populated. - public var peerUpdate: Vpn_PeerUpdate { - get {return _peerUpdate ?? Vpn_PeerUpdate()} - set {_peerUpdate = newValue} - } - /// Returns true if `peerUpdate` has been explicitly set. - public var hasPeerUpdate: Bool {return self._peerUpdate != nil} - /// Clears the value of `peerUpdate`. Subsequent reads from it will return its default value. - public mutating func clearPeerUpdate() {self._peerUpdate = nil} - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public enum Lifecycle: SwiftProtobuf.Enum, Swift.CaseIterable { - public typealias RawValue = Int - case unknown // = 0 - case starting // = 1 - case started // = 2 - case stopping // = 3 - case stopped // = 4 - case UNRECOGNIZED(Int) - - public init() { - self = .unknown - } - - public init?(rawValue: Int) { - switch rawValue { - case 0: self = .unknown - case 1: self = .starting - case 2: self = .started - case 3: self = .stopping - case 4: self = .stopped - default: self = .UNRECOGNIZED(rawValue) - } - } - - public var rawValue: Int { - switch self { - case .unknown: return 0 - case .starting: return 1 - case .started: return 2 - case .stopping: return 3 - case .stopped: return 4 - case .UNRECOGNIZED(let i): return i - } - } - - // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Vpn_Status.Lifecycle] = [ - .unknown, - .starting, - .started, - .stopping, - .stopped, - ] - - } - - public init() {} - - fileprivate var _peerUpdate: Vpn_PeerUpdate? = nil -} - -/// WakeRequest is sent by the manager after the system wakes from sleep. The -/// tunnel uses this as a hint to rediscover network paths. -public struct Vpn_WakeRequest: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -public struct Vpn_WakeResponse: Sendable { - // SwiftProtobuf.Message conformance is added in an extension below. See the - // `Message` and `Message+*Additions` files in the SwiftProtobuf library for - // methods supported on all messages. - - public var unknownFields = SwiftProtobuf.UnknownStorage() - - public init() {} -} - -// MARK: - Code below here is support for the SwiftProtobuf runtime. - -fileprivate let _protobuf_package = "vpn" - -extension Vpn_RPC: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".RPC" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "msg_id"), - 2: .standard(proto: "response_to"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt64Field(value: &self.msgID) }() - case 2: try { try decoder.decodeSingularUInt64Field(value: &self.responseTo) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.msgID != 0 { - try visitor.visitSingularUInt64Field(value: self.msgID, fieldNumber: 1) - } - if self.responseTo != 0 { - try visitor.visitSingularUInt64Field(value: self.responseTo, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_RPC, rhs: Vpn_RPC) -> Bool { - if lhs.msgID != rhs.msgID {return false} - if lhs.responseTo != rhs.responseTo {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_ManagerMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ManagerMessage" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "rpc"), - 2: .standard(proto: "get_peer_update"), - 3: .standard(proto: "network_settings"), - 4: .same(proto: "start"), - 5: .same(proto: "stop"), - 6: .same(proto: "wake"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rpc) }() - case 2: try { - var v: Vpn_GetPeerUpdate? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .getPeerUpdate(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .getPeerUpdate(v) - } - }() - case 3: try { - var v: Vpn_NetworkSettingsResponse? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .networkSettings(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .networkSettings(v) - } - }() - case 4: try { - var v: Vpn_StartRequest? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .start(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .start(v) - } - }() - case 5: try { - var v: Vpn_StopRequest? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .stop(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .stop(v) - } - }() - case 6: try { - var v: Vpn_WakeRequest? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .wake(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .wake(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rpc { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.msg { - case .getPeerUpdate?: try { - guard case .getPeerUpdate(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .networkSettings?: try { - guard case .networkSettings(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .start?: try { - guard case .start(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .stop?: try { - guard case .stop(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case .wake?: try { - guard case .wake(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_ManagerMessage, rhs: Vpn_ManagerMessage) -> Bool { - if lhs._rpc != rhs._rpc {return false} - if lhs.msg != rhs.msg {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_TunnelMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TunnelMessage" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "rpc"), - 2: .same(proto: "log"), - 3: .standard(proto: "peer_update"), - 4: .standard(proto: "network_settings"), - 5: .same(proto: "start"), - 6: .same(proto: "stop"), - 7: .same(proto: "wake"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rpc) }() - case 2: try { - var v: Vpn_Log? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .log(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .log(v) - } - }() - case 3: try { - var v: Vpn_PeerUpdate? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .peerUpdate(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .peerUpdate(v) - } - }() - case 4: try { - var v: Vpn_NetworkSettingsRequest? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .networkSettings(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .networkSettings(v) - } - }() - case 5: try { - var v: Vpn_StartResponse? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .start(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .start(v) - } - }() - case 6: try { - var v: Vpn_StopResponse? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .stop(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .stop(v) - } - }() - case 7: try { - var v: Vpn_WakeResponse? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .wake(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .wake(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rpc { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.msg { - case .log?: try { - guard case .log(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .peerUpdate?: try { - guard case .peerUpdate(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .networkSettings?: try { - guard case .networkSettings(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case .start?: try { - guard case .start(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - }() - case .stop?: try { - guard case .stop(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - }() - case .wake?: try { - guard case .wake(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_TunnelMessage, rhs: Vpn_TunnelMessage) -> Bool { - if lhs._rpc != rhs._rpc {return false} - if lhs.msg != rhs.msg {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_ClientMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ClientMessage" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "rpc"), - 2: .same(proto: "start"), - 3: .same(proto: "stop"), - 4: .same(proto: "status"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rpc) }() - case 2: try { - var v: Vpn_StartRequest? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .start(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .start(v) - } - }() - case 3: try { - var v: Vpn_StopRequest? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .stop(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .stop(v) - } - }() - case 4: try { - var v: Vpn_StatusRequest? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .status(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .status(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rpc { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.msg { - case .start?: try { - guard case .start(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .stop?: try { - guard case .stop(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .status?: try { - guard case .status(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_ClientMessage, rhs: Vpn_ClientMessage) -> Bool { - if lhs._rpc != rhs._rpc {return false} - if lhs.msg != rhs.msg {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_ServiceMessage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".ServiceMessage" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "rpc"), - 2: .same(proto: "start"), - 3: .same(proto: "stop"), - 4: .same(proto: "status"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._rpc) }() - case 2: try { - var v: Vpn_StartResponse? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .start(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .start(v) - } - }() - case 3: try { - var v: Vpn_StopResponse? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .stop(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .stop(v) - } - }() - case 4: try { - var v: Vpn_Status? - var hadOneofValue = false - if let current = self.msg { - hadOneofValue = true - if case .status(let m) = current {v = m} - } - try decoder.decodeSingularMessageField(value: &v) - if let v = v { - if hadOneofValue {try decoder.handleConflictingOneOf()} - self.msg = .status(v) - } - }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._rpc { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - switch self.msg { - case .start?: try { - guard case .start(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - }() - case .stop?: try { - guard case .stop(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - }() - case .status?: try { - guard case .status(let v)? = self.msg else { preconditionFailure() } - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - }() - case nil: break - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_ServiceMessage, rhs: Vpn_ServiceMessage) -> Bool { - if lhs._rpc != rhs._rpc {return false} - if lhs.msg != rhs.msg {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_Log: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Log" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "level"), - 2: .same(proto: "message"), - 3: .standard(proto: "logger_names"), - 4: .same(proto: "fields"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.level) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.message) }() - case 3: try { try decoder.decodeRepeatedStringField(value: &self.loggerNames) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.fields) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.level != .debug { - try visitor.visitSingularEnumField(value: self.level, fieldNumber: 1) - } - if !self.message.isEmpty { - try visitor.visitSingularStringField(value: self.message, fieldNumber: 2) - } - if !self.loggerNames.isEmpty { - try visitor.visitRepeatedStringField(value: self.loggerNames, fieldNumber: 3) - } - if !self.fields.isEmpty { - try visitor.visitRepeatedMessageField(value: self.fields, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_Log, rhs: Vpn_Log) -> Bool { - if lhs.level != rhs.level {return false} - if lhs.message != rhs.message {return false} - if lhs.loggerNames != rhs.loggerNames {return false} - if lhs.fields != rhs.fields {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_Log.Level: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "DEBUG"), - 1: .same(proto: "INFO"), - 2: .same(proto: "WARN"), - 3: .same(proto: "ERROR"), - 4: .same(proto: "CRITICAL"), - 5: .same(proto: "FATAL"), - ] -} - -extension Vpn_Log.Field: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Vpn_Log.protoMessageName + ".Field" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "value"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_Log.Field, rhs: Vpn_Log.Field) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_GetPeerUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".GetPeerUpdate" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_GetPeerUpdate, rhs: Vpn_GetPeerUpdate) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_PeerUpdate: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".PeerUpdate" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "upserted_workspaces"), - 2: .standard(proto: "upserted_agents"), - 3: .standard(proto: "deleted_workspaces"), - 4: .standard(proto: "deleted_agents"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedMessageField(value: &self.upsertedWorkspaces) }() - case 2: try { try decoder.decodeRepeatedMessageField(value: &self.upsertedAgents) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.deletedWorkspaces) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.deletedAgents) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.upsertedWorkspaces.isEmpty { - try visitor.visitRepeatedMessageField(value: self.upsertedWorkspaces, fieldNumber: 1) - } - if !self.upsertedAgents.isEmpty { - try visitor.visitRepeatedMessageField(value: self.upsertedAgents, fieldNumber: 2) - } - if !self.deletedWorkspaces.isEmpty { - try visitor.visitRepeatedMessageField(value: self.deletedWorkspaces, fieldNumber: 3) - } - if !self.deletedAgents.isEmpty { - try visitor.visitRepeatedMessageField(value: self.deletedAgents, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_PeerUpdate, rhs: Vpn_PeerUpdate) -> Bool { - if lhs.upsertedWorkspaces != rhs.upsertedWorkspaces {return false} - if lhs.upsertedAgents != rhs.upsertedAgents {return false} - if lhs.deletedWorkspaces != rhs.deletedWorkspaces {return false} - if lhs.deletedAgents != rhs.deletedAgents {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_Workspace: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Workspace" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "name"), - 3: .same(proto: "status"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.id) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 3: try { try decoder.decodeSingularEnumField(value: &self.status) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.id.isEmpty { - try visitor.visitSingularBytesField(value: self.id, fieldNumber: 1) - } - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) - } - if self.status != .unknown { - try visitor.visitSingularEnumField(value: self.status, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_Workspace, rhs: Vpn_Workspace) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.name != rhs.name {return false} - if lhs.status != rhs.status {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_Workspace.Status: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "PENDING"), - 2: .same(proto: "STARTING"), - 3: .same(proto: "RUNNING"), - 4: .same(proto: "STOPPING"), - 5: .same(proto: "STOPPED"), - 6: .same(proto: "FAILED"), - 7: .same(proto: "CANCELING"), - 8: .same(proto: "CANCELED"), - 9: .same(proto: "DELETING"), - 10: .same(proto: "DELETED"), - ] -} - -extension Vpn_Agent: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Agent" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "id"), - 2: .same(proto: "name"), - 3: .standard(proto: "workspace_id"), - 4: .same(proto: "fqdn"), - 5: .standard(proto: "ip_addrs"), - 6: .standard(proto: "last_handshake"), - 7: .standard(proto: "last_ping"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBytesField(value: &self.id) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self.workspaceID) }() - case 4: try { try decoder.decodeRepeatedStringField(value: &self.fqdn) }() - case 5: try { try decoder.decodeRepeatedStringField(value: &self.ipAddrs) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._lastHandshake) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._lastPing) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if !self.id.isEmpty { - try visitor.visitSingularBytesField(value: self.id, fieldNumber: 1) - } - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 2) - } - if !self.workspaceID.isEmpty { - try visitor.visitSingularBytesField(value: self.workspaceID, fieldNumber: 3) - } - if !self.fqdn.isEmpty { - try visitor.visitRepeatedStringField(value: self.fqdn, fieldNumber: 4) - } - if !self.ipAddrs.isEmpty { - try visitor.visitRepeatedStringField(value: self.ipAddrs, fieldNumber: 5) - } - try { if let v = self._lastHandshake { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - try { if let v = self._lastPing { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_Agent, rhs: Vpn_Agent) -> Bool { - if lhs.id != rhs.id {return false} - if lhs.name != rhs.name {return false} - if lhs.workspaceID != rhs.workspaceID {return false} - if lhs.fqdn != rhs.fqdn {return false} - if lhs.ipAddrs != rhs.ipAddrs {return false} - if lhs._lastHandshake != rhs._lastHandshake {return false} - if lhs._lastPing != rhs._lastPing {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_LastPing: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".LastPing" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "latency"), - 2: .standard(proto: "did_p2p"), - 3: .standard(proto: "preferred_derp"), - 4: .standard(proto: "preferred_derp_latency"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularMessageField(value: &self._latency) }() - case 2: try { try decoder.decodeSingularBoolField(value: &self.didP2P) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.preferredDerp) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._preferredDerpLatency) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._latency { - try visitor.visitSingularMessageField(value: v, fieldNumber: 1) - } }() - if self.didP2P != false { - try visitor.visitSingularBoolField(value: self.didP2P, fieldNumber: 2) - } - if !self.preferredDerp.isEmpty { - try visitor.visitSingularStringField(value: self.preferredDerp, fieldNumber: 3) - } - try { if let v = self._preferredDerpLatency { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_LastPing, rhs: Vpn_LastPing) -> Bool { - if lhs._latency != rhs._latency {return false} - if lhs.didP2P != rhs.didP2P {return false} - if lhs.preferredDerp != rhs.preferredDerp {return false} - if lhs._preferredDerpLatency != rhs._preferredDerpLatency {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_NetworkSettingsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NetworkSettingsRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "tunnel_overhead_bytes"), - 2: .same(proto: "mtu"), - 3: .standard(proto: "dns_settings"), - 4: .standard(proto: "tunnel_remote_address"), - 5: .standard(proto: "ipv4_settings"), - 6: .standard(proto: "ipv6_settings"), - ] - - fileprivate class _StorageClass { - var _tunnelOverheadBytes: UInt32 = 0 - var _mtu: UInt32 = 0 - var _dnsSettings: Vpn_NetworkSettingsRequest.DNSSettings? = nil - var _tunnelRemoteAddress: String = String() - var _ipv4Settings: Vpn_NetworkSettingsRequest.IPv4Settings? = nil - var _ipv6Settings: Vpn_NetworkSettingsRequest.IPv6Settings? = nil - - #if swift(>=5.10) - // This property is used as the initial default value for new instances of the type. - // The type itself is protecting the reference to its storage via CoW semantics. - // This will force a copy to be made of this reference when the first mutation occurs; - // hence, it is safe to mark this as `nonisolated(unsafe)`. - static nonisolated(unsafe) let defaultInstance = _StorageClass() - #else - static let defaultInstance = _StorageClass() - #endif - - private init() {} - - init(copying source: _StorageClass) { - _tunnelOverheadBytes = source._tunnelOverheadBytes - _mtu = source._mtu - _dnsSettings = source._dnsSettings - _tunnelRemoteAddress = source._tunnelRemoteAddress - _ipv4Settings = source._ipv4Settings - _ipv6Settings = source._ipv6Settings - } - } - - fileprivate mutating func _uniqueStorage() -> _StorageClass { - if !isKnownUniquelyReferenced(&_storage) { - _storage = _StorageClass(copying: _storage) - } - return _storage - } - - public mutating func decodeMessage(decoder: inout D) throws { - _ = _uniqueStorage() - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularUInt32Field(value: &_storage._tunnelOverheadBytes) }() - case 2: try { try decoder.decodeSingularUInt32Field(value: &_storage._mtu) }() - case 3: try { try decoder.decodeSingularMessageField(value: &_storage._dnsSettings) }() - case 4: try { try decoder.decodeSingularStringField(value: &_storage._tunnelRemoteAddress) }() - case 5: try { try decoder.decodeSingularMessageField(value: &_storage._ipv4Settings) }() - case 6: try { try decoder.decodeSingularMessageField(value: &_storage._ipv6Settings) }() - default: break - } - } - } - } - - public func traverse(visitor: inout V) throws { - try withExtendedLifetime(_storage) { (_storage: _StorageClass) in - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if _storage._tunnelOverheadBytes != 0 { - try visitor.visitSingularUInt32Field(value: _storage._tunnelOverheadBytes, fieldNumber: 1) - } - if _storage._mtu != 0 { - try visitor.visitSingularUInt32Field(value: _storage._mtu, fieldNumber: 2) - } - try { if let v = _storage._dnsSettings { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - if !_storage._tunnelRemoteAddress.isEmpty { - try visitor.visitSingularStringField(value: _storage._tunnelRemoteAddress, fieldNumber: 4) - } - try { if let v = _storage._ipv4Settings { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try { if let v = _storage._ipv6Settings { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_NetworkSettingsRequest, rhs: Vpn_NetworkSettingsRequest) -> Bool { - if lhs._storage !== rhs._storage { - let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in - let _storage = _args.0 - let rhs_storage = _args.1 - if _storage._tunnelOverheadBytes != rhs_storage._tunnelOverheadBytes {return false} - if _storage._mtu != rhs_storage._mtu {return false} - if _storage._dnsSettings != rhs_storage._dnsSettings {return false} - if _storage._tunnelRemoteAddress != rhs_storage._tunnelRemoteAddress {return false} - if _storage._ipv4Settings != rhs_storage._ipv4Settings {return false} - if _storage._ipv6Settings != rhs_storage._ipv6Settings {return false} - return true - } - if !storagesAreEqual {return false} - } - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_NetworkSettingsRequest.DNSSettings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Vpn_NetworkSettingsRequest.protoMessageName + ".DNSSettings" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "servers"), - 2: .standard(proto: "search_domains"), - 3: .standard(proto: "domain_name"), - 4: .standard(proto: "match_domains"), - 5: .standard(proto: "match_domains_no_search"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.servers) }() - case 2: try { try decoder.decodeRepeatedStringField(value: &self.searchDomains) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.domainName) }() - case 4: try { try decoder.decodeRepeatedStringField(value: &self.matchDomains) }() - case 5: try { try decoder.decodeSingularBoolField(value: &self.matchDomainsNoSearch) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.servers.isEmpty { - try visitor.visitRepeatedStringField(value: self.servers, fieldNumber: 1) - } - if !self.searchDomains.isEmpty { - try visitor.visitRepeatedStringField(value: self.searchDomains, fieldNumber: 2) - } - if !self.domainName.isEmpty { - try visitor.visitSingularStringField(value: self.domainName, fieldNumber: 3) - } - if !self.matchDomains.isEmpty { - try visitor.visitRepeatedStringField(value: self.matchDomains, fieldNumber: 4) - } - if self.matchDomainsNoSearch != false { - try visitor.visitSingularBoolField(value: self.matchDomainsNoSearch, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_NetworkSettingsRequest.DNSSettings, rhs: Vpn_NetworkSettingsRequest.DNSSettings) -> Bool { - if lhs.servers != rhs.servers {return false} - if lhs.searchDomains != rhs.searchDomains {return false} - if lhs.domainName != rhs.domainName {return false} - if lhs.matchDomains != rhs.matchDomains {return false} - if lhs.matchDomainsNoSearch != rhs.matchDomainsNoSearch {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_NetworkSettingsRequest.IPv4Settings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Vpn_NetworkSettingsRequest.protoMessageName + ".IPv4Settings" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "addrs"), - 2: .standard(proto: "subnet_masks"), - 3: .same(proto: "router"), - 4: .standard(proto: "included_routes"), - 5: .standard(proto: "excluded_routes"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.addrs) }() - case 2: try { try decoder.decodeRepeatedStringField(value: &self.subnetMasks) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.router) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.includedRoutes) }() - case 5: try { try decoder.decodeRepeatedMessageField(value: &self.excludedRoutes) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.addrs.isEmpty { - try visitor.visitRepeatedStringField(value: self.addrs, fieldNumber: 1) - } - if !self.subnetMasks.isEmpty { - try visitor.visitRepeatedStringField(value: self.subnetMasks, fieldNumber: 2) - } - if !self.router.isEmpty { - try visitor.visitSingularStringField(value: self.router, fieldNumber: 3) - } - if !self.includedRoutes.isEmpty { - try visitor.visitRepeatedMessageField(value: self.includedRoutes, fieldNumber: 4) - } - if !self.excludedRoutes.isEmpty { - try visitor.visitRepeatedMessageField(value: self.excludedRoutes, fieldNumber: 5) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_NetworkSettingsRequest.IPv4Settings, rhs: Vpn_NetworkSettingsRequest.IPv4Settings) -> Bool { - if lhs.addrs != rhs.addrs {return false} - if lhs.subnetMasks != rhs.subnetMasks {return false} - if lhs.router != rhs.router {return false} - if lhs.includedRoutes != rhs.includedRoutes {return false} - if lhs.excludedRoutes != rhs.excludedRoutes {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_NetworkSettingsRequest.IPv4Settings.IPv4Route: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Vpn_NetworkSettingsRequest.IPv4Settings.protoMessageName + ".IPv4Route" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "destination"), - 2: .same(proto: "mask"), - 3: .same(proto: "router"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.destination) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.mask) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.router) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.destination.isEmpty { - try visitor.visitSingularStringField(value: self.destination, fieldNumber: 1) - } - if !self.mask.isEmpty { - try visitor.visitSingularStringField(value: self.mask, fieldNumber: 2) - } - if !self.router.isEmpty { - try visitor.visitSingularStringField(value: self.router, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_NetworkSettingsRequest.IPv4Settings.IPv4Route, rhs: Vpn_NetworkSettingsRequest.IPv4Settings.IPv4Route) -> Bool { - if lhs.destination != rhs.destination {return false} - if lhs.mask != rhs.mask {return false} - if lhs.router != rhs.router {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_NetworkSettingsRequest.IPv6Settings: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Vpn_NetworkSettingsRequest.protoMessageName + ".IPv6Settings" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "addrs"), - 2: .standard(proto: "prefix_lengths"), - 3: .standard(proto: "included_routes"), - 4: .standard(proto: "excluded_routes"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeRepeatedStringField(value: &self.addrs) }() - case 2: try { try decoder.decodeRepeatedUInt32Field(value: &self.prefixLengths) }() - case 3: try { try decoder.decodeRepeatedMessageField(value: &self.includedRoutes) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.excludedRoutes) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.addrs.isEmpty { - try visitor.visitRepeatedStringField(value: self.addrs, fieldNumber: 1) - } - if !self.prefixLengths.isEmpty { - try visitor.visitPackedUInt32Field(value: self.prefixLengths, fieldNumber: 2) - } - if !self.includedRoutes.isEmpty { - try visitor.visitRepeatedMessageField(value: self.includedRoutes, fieldNumber: 3) - } - if !self.excludedRoutes.isEmpty { - try visitor.visitRepeatedMessageField(value: self.excludedRoutes, fieldNumber: 4) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_NetworkSettingsRequest.IPv6Settings, rhs: Vpn_NetworkSettingsRequest.IPv6Settings) -> Bool { - if lhs.addrs != rhs.addrs {return false} - if lhs.prefixLengths != rhs.prefixLengths {return false} - if lhs.includedRoutes != rhs.includedRoutes {return false} - if lhs.excludedRoutes != rhs.excludedRoutes {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_NetworkSettingsRequest.IPv6Settings.IPv6Route: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Vpn_NetworkSettingsRequest.IPv6Settings.protoMessageName + ".IPv6Route" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "destination"), - 2: .standard(proto: "prefix_length"), - 3: .same(proto: "router"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.destination) }() - case 2: try { try decoder.decodeSingularUInt32Field(value: &self.prefixLength) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.router) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.destination.isEmpty { - try visitor.visitSingularStringField(value: self.destination, fieldNumber: 1) - } - if self.prefixLength != 0 { - try visitor.visitSingularUInt32Field(value: self.prefixLength, fieldNumber: 2) - } - if !self.router.isEmpty { - try visitor.visitSingularStringField(value: self.router, fieldNumber: 3) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_NetworkSettingsRequest.IPv6Settings.IPv6Route, rhs: Vpn_NetworkSettingsRequest.IPv6Settings.IPv6Route) -> Bool { - if lhs.destination != rhs.destination {return false} - if lhs.prefixLength != rhs.prefixLength {return false} - if lhs.router != rhs.router {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_NetworkSettingsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".NetworkSettingsResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "success"), - 2: .standard(proto: "error_message"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.success) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.success != false { - try visitor.visitSingularBoolField(value: self.success, fieldNumber: 1) - } - if !self.errorMessage.isEmpty { - try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_NetworkSettingsResponse, rhs: Vpn_NetworkSettingsResponse) -> Bool { - if lhs.success != rhs.success {return false} - if lhs.errorMessage != rhs.errorMessage {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_StartRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StartRequest" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .standard(proto: "tunnel_file_descriptor"), - 2: .standard(proto: "coder_url"), - 3: .standard(proto: "api_token"), - 4: .same(proto: "headers"), - 5: .standard(proto: "device_id"), - 6: .standard(proto: "device_os"), - 7: .standard(proto: "coder_desktop_version"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularInt32Field(value: &self.tunnelFileDescriptor) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.coderURL) }() - case 3: try { try decoder.decodeSingularStringField(value: &self.apiToken) }() - case 4: try { try decoder.decodeRepeatedMessageField(value: &self.headers) }() - case 5: try { try decoder.decodeSingularStringField(value: &self.deviceID) }() - case 6: try { try decoder.decodeSingularStringField(value: &self.deviceOs) }() - case 7: try { try decoder.decodeSingularStringField(value: &self.coderDesktopVersion) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.tunnelFileDescriptor != 0 { - try visitor.visitSingularInt32Field(value: self.tunnelFileDescriptor, fieldNumber: 1) - } - if !self.coderURL.isEmpty { - try visitor.visitSingularStringField(value: self.coderURL, fieldNumber: 2) - } - if !self.apiToken.isEmpty { - try visitor.visitSingularStringField(value: self.apiToken, fieldNumber: 3) - } - if !self.headers.isEmpty { - try visitor.visitRepeatedMessageField(value: self.headers, fieldNumber: 4) - } - if !self.deviceID.isEmpty { - try visitor.visitSingularStringField(value: self.deviceID, fieldNumber: 5) - } - if !self.deviceOs.isEmpty { - try visitor.visitSingularStringField(value: self.deviceOs, fieldNumber: 6) - } - if !self.coderDesktopVersion.isEmpty { - try visitor.visitSingularStringField(value: self.coderDesktopVersion, fieldNumber: 7) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_StartRequest, rhs: Vpn_StartRequest) -> Bool { - if lhs.tunnelFileDescriptor != rhs.tunnelFileDescriptor {return false} - if lhs.coderURL != rhs.coderURL {return false} - if lhs.apiToken != rhs.apiToken {return false} - if lhs.headers != rhs.headers {return false} - if lhs.deviceID != rhs.deviceID {return false} - if lhs.deviceOs != rhs.deviceOs {return false} - if lhs.coderDesktopVersion != rhs.coderDesktopVersion {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_StartRequest.Header: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = Vpn_StartRequest.protoMessageName + ".Header" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "name"), - 2: .same(proto: "value"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularStringField(value: &self.name) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.value) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if !self.name.isEmpty { - try visitor.visitSingularStringField(value: self.name, fieldNumber: 1) - } - if !self.value.isEmpty { - try visitor.visitSingularStringField(value: self.value, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_StartRequest.Header, rhs: Vpn_StartRequest.Header) -> Bool { - if lhs.name != rhs.name {return false} - if lhs.value != rhs.value {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_StartResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StartResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "success"), - 2: .standard(proto: "error_message"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.success) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.success != false { - try visitor.visitSingularBoolField(value: self.success, fieldNumber: 1) - } - if !self.errorMessage.isEmpty { - try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_StartResponse, rhs: Vpn_StartResponse) -> Bool { - if lhs.success != rhs.success {return false} - if lhs.errorMessage != rhs.errorMessage {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_StopRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StopRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_StopRequest, rhs: Vpn_StopRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_StopResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StopResponse" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "success"), - 2: .standard(proto: "error_message"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self.success) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - if self.success != false { - try visitor.visitSingularBoolField(value: self.success, fieldNumber: 1) - } - if !self.errorMessage.isEmpty { - try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 2) - } - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_StopResponse, rhs: Vpn_StopResponse) -> Bool { - if lhs.success != rhs.success {return false} - if lhs.errorMessage != rhs.errorMessage {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_StatusRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".StatusRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_StatusRequest, rhs: Vpn_StatusRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_Status: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".Status" - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 1: .same(proto: "lifecycle"), - 2: .standard(proto: "error_message"), - 3: .standard(proto: "peer_update"), - ] - - public mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self.lifecycle) }() - case 2: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._peerUpdate) }() - default: break - } - } - } - - public func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - if self.lifecycle != .unknown { - try visitor.visitSingularEnumField(value: self.lifecycle, fieldNumber: 1) - } - if !self.errorMessage.isEmpty { - try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 2) - } - try { if let v = self._peerUpdate { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_Status, rhs: Vpn_Status) -> Bool { - if lhs.lifecycle != rhs.lifecycle {return false} - if lhs.errorMessage != rhs.errorMessage {return false} - if lhs._peerUpdate != rhs._peerUpdate {return false} - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_Status.Lifecycle: SwiftProtobuf._ProtoNameProviding { - public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ - 0: .same(proto: "UNKNOWN"), - 1: .same(proto: "STARTING"), - 2: .same(proto: "STARTED"), - 3: .same(proto: "STOPPING"), - 4: .same(proto: "STOPPED"), - ] -} - -extension Vpn_WakeRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".WakeRequest" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_WakeRequest, rhs: Vpn_WakeRequest) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} - -extension Vpn_WakeResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".WakeResponse" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap() - - public mutating func decodeMessage(decoder: inout D) throws { - // Load everything into unknown fields - while try decoder.nextFieldNumber() != nil {} - } - - public func traverse(visitor: inout V) throws { - try unknownFields.traverse(visitor: &visitor) - } - - public static func ==(lhs: Vpn_WakeResponse, rhs: Vpn_WakeResponse) -> Bool { - if lhs.unknownFields != rhs.unknownFields {return false} - return true - } -} diff --git a/Coder-Desktop/project.yml b/Coder-Desktop/project.yml index bcc80520..da6ce992 100644 --- a/Coder-Desktop/project.yml +++ b/Coder-Desktop/project.yml @@ -2,12 +2,15 @@ name: "Coder-Desktop" options: bundleIdPrefix: com.coder deploymentTarget: - macOS: "14.0" + macOS: "15.0" xcodeVersion: "1600" minimumXcodeGenVersion: "2.42.0" fileTypes: + # Inputs to the GRPCProtobufGenerator plugin, see VPNLib's buildRules proto: - buildPhase: none + buildPhase: sources + json: + buildPhase: sources "icon": file: true @@ -91,10 +94,10 @@ settings: packages: ViewInspector: url: https://github.com/nalexn/ViewInspector - from: 0.10.0 + from: 0.10.5 SwiftLintPlugins: url: https://github.com/SimplyDanny/SwiftLintPlugins - from: 0.57.1 + from: 0.65.1 FluidMenuBarExtra: # Forked to: # - Dynamically update the menu bar icon @@ -107,35 +110,40 @@ packages: branch: e0c7eebc5a4465a3c4680764f26b7a61f567cdaf SwiftProtobuf: url: https://github.com/apple/swift-protobuf.git - exactVersion: 1.28.2 + exactVersion: 1.39.0 Mocker: url: https://github.com/WeTransfer/Mocker from: 3.0.2 LaunchAtLogin: url: https://github.com/sindresorhus/LaunchAtLogin-modern from: 1.1.0 - GRPC: - url: https://github.com/grpc/grpc-swift - # v2 does not support macOS 14.0 - exactVersion: 1.24.2 + GRPCCore: + url: https://github.com/grpc/grpc-swift-2 + exactVersion: 2.4.4 + GRPCProtobuf: + url: https://github.com/grpc/grpc-swift-protobuf + exactVersion: 2.5.0 + GRPCNIOTransport: + url: https://github.com/grpc/grpc-swift-nio-transport + exactVersion: 2.11.0 Subprocess: url: https://github.com/jamf/Subprocess - revision: 9d67b79 + exactVersion: 4.0.1 Semaphore: url: https://github.com/groue/Semaphore/ exactVersion: 0.1.0 SDWebImageSwiftUI: url: https://github.com/SDWebImage/SDWebImageSwiftUI - exactVersion: 3.1.3 + exactVersion: 3.1.4 SDWebImageSVGCoder: url: https://github.com/SDWebImage/SDWebImageSVGCoder - exactVersion: 1.7.0 + exactVersion: 1.8.0 URLRouting: url: https://github.com/pointfreeco/swift-url-routing - revision: 09b155d + exactVersion: 0.7.0 Sparkle: url: https://github.com/sparkle-project/Sparkle - exactVersion: 2.7.0 + exactVersion: 2.10.1 targets: @@ -333,11 +341,32 @@ targets: scheme: testTargets: - VPNLibTests + buildToolPlugins: + # Generates the Swift code for the .proto files, as configured by each + # grpc-swift-proto-generator-config.json. + - plugin: GRPCProtobufGenerator + package: GRPCProtobuf + buildRules: + # Xcode only passes files in a build phase to build tool plugins, so the + # .proto files and plugin configs are in the sources phase. These no-op + # rules stop Xcode warning that it doesn't know how to compile them. + # Xcode requires them to have an output. + - name: Protobuf definitions + fileType: sourcecode.protobuf + script: touch "${SCRIPT_OUTPUT_FILE_0}" + outputFiles: + - "$(DERIVED_FILE_DIR)/$(INPUT_FILE_PATH:c99extidentifier).stamp" + - name: GRPCProtobufGenerator configs + fileType: text.json + script: touch "${SCRIPT_OUTPUT_FILE_0}" + outputFiles: + - "$(DERIVED_FILE_DIR)/$(INPUT_FILE_PATH:c99extidentifier).stamp" dependencies: - package: SwiftProtobuf - - package: SwiftProtobuf - product: SwiftProtobufPluginLibrary - - package: GRPC + - package: GRPCCore + - package: GRPCProtobuf + - package: GRPCNIOTransport + product: GRPCNIOTransportHTTP2Posix - package: Subprocess - package: Semaphore - package: URLRouting diff --git a/Makefile b/Makefile index 4172f04d..9c9e45c9 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,6 @@ SCHEME := Coder\ Desktop TEST_PLAN := Coder-Desktop SWIFT_VERSION := 6.0 -MUTAGEN_PROTO_DEFS := $(shell find $(PROJECT)/VPNLib/FileSync/MutagenSDK -type f -name '*.proto' -print) -MUTAGEN_PROTO_SWIFTS := $(patsubst %.proto,%.pb.swift,$(MUTAGEN_PROTO_DEFS)) MUTAGEN_RESOURCES := mutagen-agents.tar.gz mutagen-darwin-arm64 mutagen-darwin-amd64 ifndef MUTAGEN_VERSION @@ -63,9 +61,7 @@ APP_SIGNING_KEYCHAIN := $(if $(wildcard $(KEYCHAIN_FILE)),$(shell realpath $(KEY .PHONY: setup setup: \ $(addprefix $(PROJECT)/Resources/,$(MUTAGEN_RESOURCES)) \ - $(XCPROJECT) \ - $(PROJECT)/VPNLib/vpn.pb.swift \ - $(MUTAGEN_PROTO_SWIFTS) + $(XCPROJECT) # Mutagen resources $(addprefix $(PROJECT)/Resources/,$(MUTAGEN_RESOURCES)): $(PROJECT)/Resources/.mutagenversion @@ -83,16 +79,6 @@ $(XCPROJECT): $(PROJECT)/project.yml GIT_COMMIT_HASH=$(GIT_COMMIT_HASH) \ xcodegen -$(PROJECT)/VPNLib/vpn.pb.swift: $(PROJECT)/VPNLib/vpn.proto - protoc --swift_opt=Visibility=public --swift_out=. 'Coder-Desktop/VPNLib/vpn.proto' - -$(MUTAGEN_PROTO_SWIFTS): - protoc \ - -I=$(PROJECT)/VPNLib/FileSync/MutagenSDK \ - --swift_out=$(PROJECT)/VPNLib/FileSync/MutagenSDK \ - --grpc-swift_out=$(PROJECT)/VPNLib/FileSync/MutagenSDK \ - $(patsubst %.pb.swift,%.proto,$@) - $(KEYCHAIN_FILE): security create-keychain -p "" "$(APP_SIGNING_KEYCHAIN)" security set-keychain-settings -lut 21600 "$(APP_SIGNING_KEYCHAIN)" @@ -180,9 +166,6 @@ clean/build: clean/mutagen: find $(PROJECT)/Resources -name 'mutagen-*' -delete -.PHONY: proto -proto: $(PROJECT)/VPNLib/vpn.pb.swift $(MUTAGEN_PROTO_SWIFTS) ## Generate Swift files from protobufs - .PHONY: help help: ## Show this help @echo "Specify a command. The choices are:" diff --git a/flake.lock b/flake.lock index e854f735..5a6a2919 100644 --- a/flake.lock +++ b/flake.lock @@ -1,25 +1,5 @@ { "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1741352980, - "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -38,47 +18,6 @@ "type": "github" } }, - "grpc-swift": { - "inputs": { - "flake-parts": [ - "flake-parts" - ], - "grpc-swift-src": "grpc-swift-src", - "nixpkgs": [ - "nixpkgs-grpc-swift" - ] - }, - "locked": { - "lastModified": 1734611727, - "narHash": "sha256-HWyTCVTAZ+R2fmK6+FoG72U1f7srF6dqaZJANsd1heE=", - "owner": "i10416", - "repo": "grpc-swift-flake", - "rev": "b3e21ab4c686be29af42ccd36c4cc476a1ccbd8e", - "type": "github" - }, - "original": { - "owner": "i10416", - "repo": "grpc-swift-flake", - "type": "github" - } - }, - "grpc-swift-src": { - "flake": false, - "locked": { - "lastModified": 1726668274, - "narHash": "sha256-uI8MpRIGGn/d00pNzBxEZgQ06Q9Ladvdlc5cGNhOnkI=", - "owner": "grpc", - "repo": "grpc-swift", - "rev": "07123ed731671e800ab8d641006613612e954746", - "type": "github" - }, - "original": { - "owner": "grpc", - "ref": "refs/tags/1.23.1", - "repo": "grpc-swift", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1793110635, @@ -95,29 +34,10 @@ "type": "github" } }, - "nixpkgs-grpc-swift": { - "locked": { - "lastModified": 1742889210, - "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "698214a32beb4f4c8e3942372c694f40848b360d", - "type": "github" - }, - "original": { - "owner": "nixos", - "repo": "nixpkgs", - "rev": "698214a32beb4f4c8e3942372c694f40848b360d", - "type": "github" - } - }, "root": { "inputs": { - "flake-parts": "flake-parts", "flake-utils": "flake-utils", - "grpc-swift": "grpc-swift", - "nixpkgs": "nixpkgs", - "nixpkgs-grpc-swift": "nixpkgs-grpc-swift" + "nixpkgs": "nixpkgs" } }, "systems": { diff --git a/flake.nix b/flake.nix index a6dae091..dc109dd7 100644 --- a/flake.nix +++ b/flake.nix @@ -4,28 +4,12 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; - flake-parts = { - url = "github:hercules-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs"; - }; - # The protoc plugins must stay in lockstep with the SwiftProtobuf and - # grpc-swift (v1) runtime versions pinned in Coder-Desktop/project.yml. - # They're built from source with nixpkgs' Swift toolchain, which newer - # nixpkgs no longer supports on Darwin, so they get their own pin that's - # independent of the rest of the toolchain. - nixpkgs-grpc-swift.url = "github:nixos/nixpkgs/698214a32beb4f4c8e3942372c694f40848b360d"; - grpc-swift = { - url = "github:i10416/grpc-swift-flake"; - inputs.nixpkgs.follows = "nixpkgs-grpc-swift"; - inputs.flake-parts.follows = "flake-parts"; - }; }; outputs = { nixpkgs, flake-utils, - grpc-swift, ... }: flake-utils.lib.eachSystem @@ -55,9 +39,6 @@ gh git gnumake - protobuf_36 - grpc-swift.packages.${system}.protoc-gen-grpc-swift - grpc-swift.packages.${system}.protoc-gen-swift swiftformat swiftlint xcbeautify diff --git a/scripts/update-appcast/Sources/main.swift b/scripts/update-appcast/Sources/main.swift index 349bc7bc..280df0eb 100644 --- a/scripts/update-appcast/Sources/main.swift +++ b/scripts/update-appcast/Sources/main.swift @@ -125,7 +125,7 @@ struct UpdateAppcast: AsyncParsableCommand { )) item.addChild(XMLElement( name: "sparkle:minimumSystemVersion", - stringValue: "14.0.0" + stringValue: "15.0.0" )) let enclosure = XMLElement(name: "enclosure") diff --git a/scripts/update-cask.sh b/scripts/update-cask.sh index 8dfb299d..f098993f 100755 --- a/scripts/update-cask.sh +++ b/scripts/update-cask.sh @@ -87,7 +87,7 @@ cask "coder-desktop" do homepage "https://github.com/coder/coder-desktop-macos" auto_updates true - depends_on macos: :sonoma + depends_on macos: :sequoia pkg "Coder-Desktop.pkg" From 9479d1743b589c86918f8fa6af7f7930c83c075d Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Thu, 29 Oct 2026 18:08:00 +1100 Subject: [PATCH 2/4] refactor: move the protos into a local Proto package The GRPCProtobufGenerator plugin only sees files in a build phase when it's attached to an Xcode target, which needed the .proto and .json files in the sources phase project-wide and no-op build rules to silence Xcode. In a Swift package the plugin picks up the files in the target directory as-is. VPNProto holds the tunnel messages and MutagenProto the Mutagen messages and gRPC clients. VPNLib imports MutagenProto internally so the Mutagen types stay out of its public API. --- .gitattributes | 2 +- .gitignore | 2 +- .../Coder-Desktop/VPN/MenuState.swift | 1 + .../Coder-Desktop/VPN/VPNService.swift | 1 + .../HelperXPCListeners.swift | 1 + .../Coder-DesktopHelper/Manager.swift | 1 + .../VPNMenuStateTests.swift | 1 + Coder-Desktop/Proto/Package.swift | 46 +++++++++++++++++++ .../Sources/MutagenProto/MutagenProto.swift | 3 ++ .../filesystem_behavior_probe_mode.proto | 0 .../grpc-swift-proto-generator-config.json | 2 +- .../MutagenProto}/selection_selection.proto | 0 .../MutagenProto}/service_daemon_daemon.proto | 0 .../service_prompting_prompting.proto | 0 ...vice_synchronization_synchronization.proto | 0 ...ynchronization_compression_algorithm.proto | 0 .../synchronization_configuration.proto | 0 .../synchronization_core_change.proto | 0 .../synchronization_core_conflict.proto | 0 .../synchronization_core_entry.proto | 0 ...nization_core_ignore_ignore_vcs_mode.proto | 0 .../synchronization_core_ignore_syntax.proto | 0 .../synchronization_core_mode.proto | 0 ...ynchronization_core_permissions_mode.proto | 0 .../synchronization_core_problem.proto | 0 ...chronization_core_symbolic_link_mode.proto | 0 .../synchronization_hashing_algorithm.proto | 0 .../synchronization_rsync_receive.proto | 0 .../synchronization_scan_mode.proto | 0 .../synchronization_session.proto | 0 .../synchronization_stage_mode.proto | 0 .../MutagenProto}/synchronization_state.proto | 0 .../synchronization_version.proto | 0 .../synchronization_watch_mode.proto | 0 .../Sources/MutagenProto}/url_url.proto | 0 .../Proto/Sources/VPNProto/VPNProto.swift | 3 ++ .../grpc-swift-proto-generator-config.json | 0 .../Sources/VPNProto}/vpn.proto | 0 Coder-Desktop/VPN/NEHelperXPCClient.swift | 1 + Coder-Desktop/VPN/PacketTunnelProvider.swift | 1 + .../VPNLib/FileSync/DaemonClient.swift | 1 + .../VPNLib/FileSync/FileSyncDaemon.swift | 1 + .../VPNLib/FileSync/FileSyncManagement.swift | 2 + .../VPNLib/FileSync/FileSyncPrompting.swift | 1 + .../VPNLib/FileSync/FileSyncSession.swift | 1 + .../VPNLib/FileSync/MutagenConvert.swift | 2 + Coder-Desktop/VPNLib/Speaker+Wake.swift | 1 + Coder-Desktop/VPNLib/Speaker.swift | 1 + Coder-Desktop/VPNLib/TelemetryEnricher.swift | 1 + Coder-Desktop/VPNLib/VPNConvert.swift | 1 + Coder-Desktop/VPNLib/XPC.swift | 1 + Coder-Desktop/VPNLibTests/ConvertTests.swift | 1 + Coder-Desktop/VPNLibTests/ProtoTests.swift | 1 + Coder-Desktop/VPNLibTests/SpeakerTests.swift | 1 + .../VPNLibTests/TelemetryEnricherTests.swift | 1 + Coder-Desktop/project.yml | 33 +++---------- scripts/mutagen-proto.sh | 2 +- 57 files changed, 87 insertions(+), 30 deletions(-) create mode 100644 Coder-Desktop/Proto/Package.swift create mode 100644 Coder-Desktop/Proto/Sources/MutagenProto/MutagenProto.swift rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/filesystem_behavior_probe_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/grpc-swift-proto-generator-config.json (79%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/selection_selection.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/service_daemon_daemon.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/service_prompting_prompting.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/service_synchronization_synchronization.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_compression_algorithm.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_configuration.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_change.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_conflict.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_entry.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_ignore_ignore_vcs_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_ignore_syntax.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_permissions_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_problem.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_core_symbolic_link_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_hashing_algorithm.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_rsync_receive.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_scan_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_session.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_stage_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_state.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_version.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/synchronization_watch_mode.proto (100%) rename Coder-Desktop/{VPNLib/FileSync/MutagenSDK => Proto/Sources/MutagenProto}/url_url.proto (100%) create mode 100644 Coder-Desktop/Proto/Sources/VPNProto/VPNProto.swift rename Coder-Desktop/{VPNLib => Proto/Sources/VPNProto}/grpc-swift-proto-generator-config.json (100%) rename Coder-Desktop/{VPNLib => Proto/Sources/VPNProto}/vpn.proto (100%) diff --git a/.gitattributes b/.gitattributes index a29cb0f0..35f45820 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -Coder-Desktop/VPNLib/FileSync/MutagenSDK/*.proto linguist-generated=true +Coder-Desktop/Proto/Sources/MutagenProto/*.proto linguist-generated=true diff --git a/.gitignore b/.gitignore index fdf22e2f..cae5c43f 100644 --- a/.gitignore +++ b/.gitignore @@ -238,7 +238,7 @@ Package.resolved *.xcodeproj # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata # hence it is not needed unless you have added a package configuration file to your project -# .swiftpm +.swiftpm .build/ diff --git a/Coder-Desktop/Coder-Desktop/VPN/MenuState.swift b/Coder-Desktop/Coder-Desktop/VPN/MenuState.swift index d3c5b10f..46703387 100644 --- a/Coder-Desktop/Coder-Desktop/VPN/MenuState.swift +++ b/Coder-Desktop/Coder-Desktop/VPN/MenuState.swift @@ -2,6 +2,7 @@ import Foundation import SwiftProtobuf import SwiftUI import VPNLib +import VPNProto struct Agent: Identifiable, Equatable, Comparable, Hashable { let id: UUID diff --git a/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift b/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift index 6215ca3e..8674729a 100644 --- a/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift +++ b/Coder-Desktop/Coder-Desktop/VPN/VPNService.swift @@ -2,6 +2,7 @@ import NetworkExtension import os import SwiftUI import VPNLib +import VPNProto @MainActor protocol VPNService: ObservableObject { diff --git a/Coder-Desktop/Coder-DesktopHelper/HelperXPCListeners.swift b/Coder-Desktop/Coder-DesktopHelper/HelperXPCListeners.swift index f079493e..941a58cf 100644 --- a/Coder-Desktop/Coder-DesktopHelper/HelperXPCListeners.swift +++ b/Coder-Desktop/Coder-DesktopHelper/HelperXPCListeners.swift @@ -2,6 +2,7 @@ import CoderSDK import Foundation import os import VPNLib +import VPNProto /// This listener handles XPC connections from the Coder Desktop System Network /// Extension (`com.coder.Coder-Desktop.VPN`). diff --git a/Coder-Desktop/Coder-DesktopHelper/Manager.swift b/Coder-Desktop/Coder-DesktopHelper/Manager.swift index a94bbf92..b88bc034 100644 --- a/Coder-Desktop/Coder-DesktopHelper/Manager.swift +++ b/Coder-Desktop/Coder-DesktopHelper/Manager.swift @@ -2,6 +2,7 @@ import CoderSDK import NetworkExtension import os import VPNLib +import VPNProto actor Manager { let cfg: ManagerConfig diff --git a/Coder-Desktop/Coder-DesktopTests/VPNMenuStateTests.swift b/Coder-Desktop/Coder-DesktopTests/VPNMenuStateTests.swift index 5821deac..15f036f1 100644 --- a/Coder-Desktop/Coder-DesktopTests/VPNMenuStateTests.swift +++ b/Coder-Desktop/Coder-DesktopTests/VPNMenuStateTests.swift @@ -1,6 +1,7 @@ @testable import Coder_Desktop import Testing @testable import VPNLib +import VPNProto @MainActor struct VPNMenuStateTests { diff --git a/Coder-Desktop/Proto/Package.swift b/Coder-Desktop/Proto/Package.swift new file mode 100644 index 00000000..7c5a10bd --- /dev/null +++ b/Coder-Desktop/Proto/Package.swift @@ -0,0 +1,46 @@ +// swift-tools-version: 6.0 + +// The protocol definitions used by Coder Desktop. The Swift code for each +// target is generated at build time from its .proto files, as configured by its +// grpc-swift-proto-generator-config.json. +// +// Coder Desktop pins the exact dependency versions in project.yml. + +import PackageDescription + +let generator = Target.PluginUsage.plugin(name: "GRPCProtobufGenerator", package: "grpc-swift-protobuf") + +let package = Package( + name: "Proto", + platforms: [.macOS(.v15)], + products: [ + .library(name: "VPNProto", targets: ["VPNProto"]), + .library(name: "MutagenProto", targets: ["MutagenProto"]), + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-protobuf.git", from: "1.39.0"), + .package(url: "https://github.com/grpc/grpc-swift-2.git", from: "2.4.4"), + .package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "2.5.0"), + ], + targets: [ + // Messages for the tunnel protocol shared with coder/coder. + .target( + name: "VPNProto", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf"), + ], + plugins: [generator] + ), + // Messages and gRPC clients for the Mutagen daemon, vendored by + // scripts/mutagen-proto.sh. + .target( + name: "MutagenProto", + dependencies: [ + .product(name: "SwiftProtobuf", package: "swift-protobuf"), + .product(name: "GRPCCore", package: "grpc-swift-2"), + .product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"), + ], + plugins: [generator] + ), + ] +) diff --git a/Coder-Desktop/Proto/Sources/MutagenProto/MutagenProto.swift b/Coder-Desktop/Proto/Sources/MutagenProto/MutagenProto.swift new file mode 100644 index 00000000..6448253f --- /dev/null +++ b/Coder-Desktop/Proto/Sources/MutagenProto/MutagenProto.swift @@ -0,0 +1,3 @@ +// The Swift code for this module is generated at build time from the .proto +// files in this directory. SwiftPM refuses to load a target with no Swift +// sources, and generated sources don't count, so this file must exist. diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/filesystem_behavior_probe_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/filesystem_behavior_probe_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/filesystem_behavior_probe_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/filesystem_behavior_probe_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/grpc-swift-proto-generator-config.json b/Coder-Desktop/Proto/Sources/MutagenProto/grpc-swift-proto-generator-config.json similarity index 79% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/grpc-swift-proto-generator-config.json rename to Coder-Desktop/Proto/Sources/MutagenProto/grpc-swift-proto-generator-config.json index e66a467c..626221e7 100644 --- a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/grpc-swift-proto-generator-config.json +++ b/Coder-Desktop/Proto/Sources/MutagenProto/grpc-swift-proto-generator-config.json @@ -5,6 +5,6 @@ "messages": true }, "generatedSource": { - "accessLevel": "internal" + "accessLevel": "public" } } diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/selection_selection.proto b/Coder-Desktop/Proto/Sources/MutagenProto/selection_selection.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/selection_selection.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/selection_selection.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.proto b/Coder-Desktop/Proto/Sources/MutagenProto/service_daemon_daemon.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_daemon_daemon.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/service_daemon_daemon.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.proto b/Coder-Desktop/Proto/Sources/MutagenProto/service_prompting_prompting.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_prompting_prompting.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/service_prompting_prompting.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.proto b/Coder-Desktop/Proto/Sources/MutagenProto/service_synchronization_synchronization.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/service_synchronization_synchronization.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/service_synchronization_synchronization.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_compression_algorithm.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_compression_algorithm.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_compression_algorithm.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_compression_algorithm.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_configuration.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_configuration.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_configuration.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_configuration.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_change.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_change.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_change.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_change.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_conflict.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_conflict.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_conflict.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_conflict.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_entry.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_entry.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_entry.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_entry.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_ignore_vcs_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_ignore_ignore_vcs_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_ignore_vcs_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_ignore_ignore_vcs_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_syntax.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_ignore_syntax.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_ignore_syntax.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_ignore_syntax.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_permissions_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_permissions_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_permissions_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_permissions_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_problem.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_problem.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_problem.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_problem.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_symbolic_link_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_symbolic_link_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_core_symbolic_link_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_core_symbolic_link_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_hashing_algorithm.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_hashing_algorithm.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_hashing_algorithm.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_hashing_algorithm.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_rsync_receive.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_rsync_receive.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_rsync_receive.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_rsync_receive.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_scan_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_scan_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_scan_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_scan_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_session.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_session.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_session.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_session.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_stage_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_stage_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_stage_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_stage_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_state.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_state.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_state.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_state.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_version.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_version.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_version.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_version.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_watch_mode.proto b/Coder-Desktop/Proto/Sources/MutagenProto/synchronization_watch_mode.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/synchronization_watch_mode.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/synchronization_watch_mode.proto diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenSDK/url_url.proto b/Coder-Desktop/Proto/Sources/MutagenProto/url_url.proto similarity index 100% rename from Coder-Desktop/VPNLib/FileSync/MutagenSDK/url_url.proto rename to Coder-Desktop/Proto/Sources/MutagenProto/url_url.proto diff --git a/Coder-Desktop/Proto/Sources/VPNProto/VPNProto.swift b/Coder-Desktop/Proto/Sources/VPNProto/VPNProto.swift new file mode 100644 index 00000000..6448253f --- /dev/null +++ b/Coder-Desktop/Proto/Sources/VPNProto/VPNProto.swift @@ -0,0 +1,3 @@ +// The Swift code for this module is generated at build time from the .proto +// files in this directory. SwiftPM refuses to load a target with no Swift +// sources, and generated sources don't count, so this file must exist. diff --git a/Coder-Desktop/VPNLib/grpc-swift-proto-generator-config.json b/Coder-Desktop/Proto/Sources/VPNProto/grpc-swift-proto-generator-config.json similarity index 100% rename from Coder-Desktop/VPNLib/grpc-swift-proto-generator-config.json rename to Coder-Desktop/Proto/Sources/VPNProto/grpc-swift-proto-generator-config.json diff --git a/Coder-Desktop/VPNLib/vpn.proto b/Coder-Desktop/Proto/Sources/VPNProto/vpn.proto similarity index 100% rename from Coder-Desktop/VPNLib/vpn.proto rename to Coder-Desktop/Proto/Sources/VPNProto/vpn.proto diff --git a/Coder-Desktop/VPN/NEHelperXPCClient.swift b/Coder-Desktop/VPN/NEHelperXPCClient.swift index b90aab75..e1a5a7be 100644 --- a/Coder-Desktop/VPN/NEHelperXPCClient.swift +++ b/Coder-Desktop/VPN/NEHelperXPCClient.swift @@ -1,6 +1,7 @@ import Foundation import os import VPNLib +import VPNProto final class HelperXPCClient: @unchecked Sendable { var ptp: PacketTunnelProvider? diff --git a/Coder-Desktop/VPN/PacketTunnelProvider.swift b/Coder-Desktop/VPN/PacketTunnelProvider.swift index 3222cdb5..f49e3bbd 100644 --- a/Coder-Desktop/VPN/PacketTunnelProvider.swift +++ b/Coder-Desktop/VPN/PacketTunnelProvider.swift @@ -2,6 +2,7 @@ import CoderSDK import NetworkExtension import os import VPNLib +import VPNProto /** From */ let CTLIOCGINFO: UInt = 0xC064_4E03 diff --git a/Coder-Desktop/VPNLib/FileSync/DaemonClient.swift b/Coder-Desktop/VPNLib/FileSync/DaemonClient.swift index ddbf05b0..6c2e2498 100644 --- a/Coder-Desktop/VPNLib/FileSync/DaemonClient.swift +++ b/Coder-Desktop/VPNLib/FileSync/DaemonClient.swift @@ -1,3 +1,4 @@ +internal import MutagenProto import GRPCCore import GRPCNIOTransportHTTP2Posix diff --git a/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift b/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift index c134506f..d5f0ae9c 100644 --- a/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift +++ b/Coder-Desktop/VPNLib/FileSync/FileSyncDaemon.swift @@ -1,3 +1,4 @@ +internal import MutagenProto import Foundation import GRPCCore import GRPCNIOTransportHTTP2Posix diff --git a/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift b/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift index a00d4b3a..5f0bb2ba 100644 --- a/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift +++ b/Coder-Desktop/VPNLib/FileSync/FileSyncManagement.swift @@ -1,3 +1,5 @@ +internal import MutagenProto + public extension MutagenDaemon { func refreshSessions() async { guard case .running = state else { return } diff --git a/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift b/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift index d6631149..c1ed1aa2 100644 --- a/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift +++ b/Coder-Desktop/VPNLib/FileSync/FileSyncPrompting.swift @@ -1,3 +1,4 @@ +internal import MutagenProto import GRPCCore extension MutagenDaemon { diff --git a/Coder-Desktop/VPNLib/FileSync/FileSyncSession.swift b/Coder-Desktop/VPNLib/FileSync/FileSyncSession.swift index b0c43f32..cbd51c06 100644 --- a/Coder-Desktop/VPNLib/FileSync/FileSyncSession.swift +++ b/Coder-Desktop/VPNLib/FileSync/FileSyncSession.swift @@ -1,3 +1,4 @@ +internal import MutagenProto import SwiftUI public struct FileSyncSession: Identifiable { diff --git a/Coder-Desktop/VPNLib/FileSync/MutagenConvert.swift b/Coder-Desktop/VPNLib/FileSync/MutagenConvert.swift index f2349938..17e2a62a 100644 --- a/Coder-Desktop/VPNLib/FileSync/MutagenConvert.swift +++ b/Coder-Desktop/VPNLib/FileSync/MutagenConvert.swift @@ -1,3 +1,5 @@ +internal import MutagenProto + // swiftlint:disable:next cyclomatic_complexity func convertSessionStatus(status: Synchronization_Status) -> FileSyncStatus { switch status { diff --git a/Coder-Desktop/VPNLib/Speaker+Wake.swift b/Coder-Desktop/VPNLib/Speaker+Wake.swift index 32211663..92b1f958 100644 --- a/Coder-Desktop/VPNLib/Speaker+Wake.swift +++ b/Coder-Desktop/VPNLib/Speaker+Wake.swift @@ -1,4 +1,5 @@ import SwiftProtobuf +import VPNProto public extension Speaker where SendMsg == Vpn_ManagerMessage, RecvMsg == Vpn_TunnelMessage { /// Asks the tunnel to rediscover network paths after system wake. diff --git a/Coder-Desktop/VPNLib/Speaker.swift b/Coder-Desktop/VPNLib/Speaker.swift index 1cc9842f..4b7a1c49 100644 --- a/Coder-Desktop/VPNLib/Speaker.swift +++ b/Coder-Desktop/VPNLib/Speaker.swift @@ -1,6 +1,7 @@ import Foundation import os import SwiftProtobuf +import VPNProto let newLine = 0x0A let headerPreamble = "codervpn" diff --git a/Coder-Desktop/VPNLib/TelemetryEnricher.swift b/Coder-Desktop/VPNLib/TelemetryEnricher.swift index 46ba1a17..d751ffb7 100644 --- a/Coder-Desktop/VPNLib/TelemetryEnricher.swift +++ b/Coder-Desktop/VPNLib/TelemetryEnricher.swift @@ -1,4 +1,5 @@ import Foundation +import VPNProto public struct TelemetryEnricher { private let deviceID: String diff --git a/Coder-Desktop/VPNLib/VPNConvert.swift b/Coder-Desktop/VPNLib/VPNConvert.swift index 5acec02c..5b837757 100644 --- a/Coder-Desktop/VPNLib/VPNConvert.swift +++ b/Coder-Desktop/VPNLib/VPNConvert.swift @@ -1,6 +1,7 @@ import NetworkExtension import os import SwiftProtobuf +import VPNProto public func convertDnsSettings(_ req: Vpn_NetworkSettingsRequest.DNSSettings) -> NEDNSSettings { let dnsSettings = NEDNSSettings(servers: req.servers) diff --git a/Coder-Desktop/VPNLib/XPC.swift b/Coder-Desktop/VPNLib/XPC.swift index 8c9c50a9..b52b6c32 100644 --- a/Coder-Desktop/VPNLib/XPC.swift +++ b/Coder-Desktop/VPNLib/XPC.swift @@ -1,4 +1,5 @@ import Foundation +import VPNProto // The Helper listens on two mach services, one for the GUI app // and one for the system network extension. diff --git a/Coder-Desktop/VPNLibTests/ConvertTests.swift b/Coder-Desktop/VPNLibTests/ConvertTests.swift index d0f7c8e3..aeaa679c 100644 --- a/Coder-Desktop/VPNLibTests/ConvertTests.swift +++ b/Coder-Desktop/VPNLibTests/ConvertTests.swift @@ -1,5 +1,6 @@ import Testing @testable import VPNLib +import VPNProto @Suite(.timeLimit(.minutes(1))) struct ConvertNetworkSettingsTests { diff --git a/Coder-Desktop/VPNLibTests/ProtoTests.swift b/Coder-Desktop/VPNLibTests/ProtoTests.swift index 42b5f0aa..ebd205ab 100644 --- a/Coder-Desktop/VPNLibTests/ProtoTests.swift +++ b/Coder-Desktop/VPNLibTests/ProtoTests.swift @@ -1,6 +1,7 @@ import Foundation import Testing @testable import VPNLib +import VPNProto @Suite(.timeLimit(.minutes(1))) struct SenderReceiverTests { diff --git a/Coder-Desktop/VPNLibTests/SpeakerTests.swift b/Coder-Desktop/VPNLibTests/SpeakerTests.swift index f4a1ef3e..91566d85 100644 --- a/Coder-Desktop/VPNLibTests/SpeakerTests.swift +++ b/Coder-Desktop/VPNLibTests/SpeakerTests.swift @@ -1,6 +1,7 @@ import Foundation import Testing @testable import VPNLib +import VPNProto @Suite(.timeLimit(.minutes(1))) struct SpeakerTests { diff --git a/Coder-Desktop/VPNLibTests/TelemetryEnricherTests.swift b/Coder-Desktop/VPNLibTests/TelemetryEnricherTests.swift index e64d1598..abed6698 100644 --- a/Coder-Desktop/VPNLibTests/TelemetryEnricherTests.swift +++ b/Coder-Desktop/VPNLibTests/TelemetryEnricherTests.swift @@ -1,5 +1,6 @@ import Testing @testable import VPNLib +import VPNProto @Suite(.timeLimit(.minutes(1))) struct TelemetryEnricherTests { diff --git a/Coder-Desktop/project.yml b/Coder-Desktop/project.yml index da6ce992..63f9d510 100644 --- a/Coder-Desktop/project.yml +++ b/Coder-Desktop/project.yml @@ -6,11 +6,6 @@ options: xcodeVersion: "1600" minimumXcodeGenVersion: "2.42.0" fileTypes: - # Inputs to the GRPCProtobufGenerator plugin, see VPNLib's buildRules - proto: - buildPhase: sources - json: - buildPhase: sources "icon": file: true @@ -111,6 +106,8 @@ packages: SwiftProtobuf: url: https://github.com/apple/swift-protobuf.git exactVersion: 1.39.0 + Proto: + path: Proto Mocker: url: https://github.com/WeTransfer/Mocker from: 3.0.2 @@ -121,6 +118,7 @@ packages: url: https://github.com/grpc/grpc-swift-2 exactVersion: 2.4.4 GRPCProtobuf: + # Only used by Proto, pinned here with the rest. url: https://github.com/grpc/grpc-swift-protobuf exactVersion: 2.5.0 GRPCNIOTransport: @@ -341,30 +339,13 @@ targets: scheme: testTargets: - VPNLibTests - buildToolPlugins: - # Generates the Swift code for the .proto files, as configured by each - # grpc-swift-proto-generator-config.json. - - plugin: GRPCProtobufGenerator - package: GRPCProtobuf - buildRules: - # Xcode only passes files in a build phase to build tool plugins, so the - # .proto files and plugin configs are in the sources phase. These no-op - # rules stop Xcode warning that it doesn't know how to compile them. - # Xcode requires them to have an output. - - name: Protobuf definitions - fileType: sourcecode.protobuf - script: touch "${SCRIPT_OUTPUT_FILE_0}" - outputFiles: - - "$(DERIVED_FILE_DIR)/$(INPUT_FILE_PATH:c99extidentifier).stamp" - - name: GRPCProtobufGenerator configs - fileType: text.json - script: touch "${SCRIPT_OUTPUT_FILE_0}" - outputFiles: - - "$(DERIVED_FILE_DIR)/$(INPUT_FILE_PATH:c99extidentifier).stamp" dependencies: + - package: Proto + product: VPNProto + - package: Proto + product: MutagenProto - package: SwiftProtobuf - package: GRPCCore - - package: GRPCProtobuf - package: GRPCNIOTransport product: GRPCNIOTransportHTTP2Posix - package: Subprocess diff --git a/scripts/mutagen-proto.sh b/scripts/mutagen-proto.sh index 287083de..d8ff44e8 100755 --- a/scripts/mutagen-proto.sh +++ b/scripts/mutagen-proto.sh @@ -25,7 +25,7 @@ proto_prefix="pkg" # Right now, we only care about the synchronization and daemon management gRPC entry_files=("service/synchronization/synchronization.proto" "service/daemon/daemon.proto" "service/prompting/prompting.proto") -out_folder="Coder-Desktop/VPNLib/FileSync/MutagenSDK" +out_folder="Coder-Desktop/Proto/Sources/MutagenProto" clone_dir="/tmp/coder-desktop-mutagen-proto" if [ -d "$clone_dir" ]; then From 29566156a3450d71c73bc54dd82cbb2098526c77 Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Thu, 29 Oct 2026 19:07:08 +1100 Subject: [PATCH 3/4] ci: opt out of Depot's Xcode compilation caching Depot runners enable Xcode compilation caching through an xcconfig that prefix maps DerivedData to /^dd. swift-protobuf's protoc finds the well-known type protos relative to __FILE__, which is remapped too, so the generator plugin fails with "google/protobuf/timestamp.proto: File not found". Passing COMPILATION_CACHE_ENABLE_CACHING=NO to xcodebuild wasn't enough, so opt out with DEPOT_XCODE_CACHE_ENABLED=0 for the jobs that build. See https://github.com/apple/swift-protobuf/pull/2060 --- .github/workflows/ci.yml | 6 ++++++ .github/workflows/release.yml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da19b060..606685f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,12 @@ jobs: test: name: test runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-26' || 'macos-26'}} + env: + # Depot's Xcode compilation caching remaps DerivedData to /^dd, which + # breaks the path swift-protobuf's protoc uses to find the well-known + # type protos (google/protobuf/*.proto) during codegen. + # See https://github.com/apple/swift-protobuf/pull/2060 + DEPOT_XCODE_CACHE_ENABLED: 0 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 38d3f208..3ae35508 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,9 @@ jobs: contents: write # for GCP auth id-token: write + env: + # See the test job in ci.yml. + DEPOT_XCODE_CACHE_ENABLED: 0 steps: - name: Checkout uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 From 42e684c9391f8396702f9e3b49c77d283f34fc4e Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Mon, 2 Nov 2026 07:40:53 +0000 Subject: [PATCH 4/4] refactor: use a case key path in CoderRouter swift-parsing deprecated `.case(CoderRoute.open(workspace:agent:route:))` in favour of a `CasePathable` case key path. Make `CoderRoute` `@CasePathable` and route through `\CoderRoute.Cases.open`. The case key path's value is the labelled payload `(workspace:agent:route:)`, while the parsers output an unlabelled `(String, String, OpenRoute)`, so add a conversion that labels the tuple. URLRouting doesn't re-export CasePaths, so add swift-case-paths as a direct VPNLib dependency, pinned to the 1.10.0 that swift-parsing already resolves. --- Coder-Desktop/VPNLib/CoderRouter.swift | 15 +++++++++++---- Coder-Desktop/project.yml | 4 ++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Coder-Desktop/VPNLib/CoderRouter.swift b/Coder-Desktop/VPNLib/CoderRouter.swift index a140934a..6a3f4163 100644 --- a/Coder-Desktop/VPNLib/CoderRouter.swift +++ b/Coder-Desktop/VPNLib/CoderRouter.swift @@ -1,3 +1,4 @@ +import CasePaths import Foundation import URLRouting @@ -7,11 +8,16 @@ public struct CoderRouter: ParserPrinter { public init() {} public var body: some ParserPrinter { - Route(.case(CoderRoute.open(workspace:agent:route:))) { + Route(.case(\CoderRoute.Cases.open)) { Scheme("coder") - // v0/open/ws//agent// - Path { "v0"; "open"; "ws"; Parse(.string); "agent"; Parse(.string) } - openRouter + Parse(.convert( + apply: { (workspace: $0, agent: $1, route: $2) }, + unapply: { ($0.workspace, $0.agent, $0.route) } + )) { + // v0/open/ws//agent// + Path { "v0"; "open"; "ws"; Parse(.string); "agent"; Parse(.string) } + openRouter + } } } @@ -74,6 +80,7 @@ public enum OpenError: Error { public var localizedDescription: String { description } } +@CasePathable public enum CoderRoute: Equatable, Sendable { case open(workspace: String, agent: String, route: OpenRoute) } diff --git a/Coder-Desktop/project.yml b/Coder-Desktop/project.yml index 63f9d510..fde7489d 100644 --- a/Coder-Desktop/project.yml +++ b/Coder-Desktop/project.yml @@ -139,6 +139,9 @@ packages: URLRouting: url: https://github.com/pointfreeco/swift-url-routing exactVersion: 0.7.0 + CasePaths: + url: https://github.com/pointfreeco/swift-case-paths + exactVersion: 1.10.0 Sparkle: url: https://github.com/sparkle-project/Sparkle exactVersion: 2.10.1 @@ -351,6 +354,7 @@ targets: - package: Subprocess - package: Semaphore - package: URLRouting + - package: CasePaths - target: CoderSDK embed: false