Share default transport ordering and connection-kind resolution across desktop and mobile opening paths. Keep explicit transport choices intact and skip unavailable default terminals before admission. Co-Authored-By: Claude Code <noreply@anthropic.com>
25 lines
568 B
Swift
25 lines
568 B
Swift
import TermindApplication
|
|
import TermindDomain
|
|
|
|
import struct TermindDomain.Host
|
|
|
|
nonisolated enum MobileConnectionProtocol: Hashable {
|
|
case ssh
|
|
case sftp
|
|
|
|
var useCase: HostUseCase {
|
|
switch self {
|
|
case .ssh: .preferredTerminal
|
|
case .sftp: .sftp
|
|
}
|
|
}
|
|
|
|
func kind(for host: Host) -> ConnectionHistoryEntry.Kind? {
|
|
guard host.supports(useCase.protocolRequirement) else { return nil }
|
|
switch self {
|
|
case .ssh: return .preferredTerminal(for: host)
|
|
case .sftp: return .sftp
|
|
}
|
|
}
|
|
}
|