diff --git a/scarf/Packages/ScarfCore/Sources/ScarfCore/Services/HermesCapabilities.swift b/scarf/Packages/ScarfCore/Sources/ScarfCore/Services/HermesCapabilities.swift index 9c408fb..f9498d0 100644 --- a/scarf/Packages/ScarfCore/Sources/ScarfCore/Services/HermesCapabilities.swift +++ b/scarf/Packages/ScarfCore/Sources/ScarfCore/Services/HermesCapabilities.swift @@ -210,6 +210,16 @@ public struct HermesCapabilities: Sendable, Equatable { /// PluginsView surfaces it as a documented hook in plugin metadata. public var hasTransformLLMOutputHook: Bool { atLeastSemver(0, 13, 0) } + // MARK: Convenience predicates + + /// Whether the connected host is on the v0.13 line or newer. Convenience + /// for UI copy that needs to switch on the v0.12 → v0.13 boundary without + /// proxying through a feature-specific flag (e.g. "v0.13 features active" + /// badges, redaction default-state hints). Equivalent to any individual + /// v0.13 flag; prefer this when the call site isn't actually about a + /// specific feature. + public var isV013OrLater: Bool { atLeastSemver(0, 13, 0) } + private func atLeastSemver(_ major: Int, _ minor: Int, _ patch: Int) -> Bool { guard let s = semver else { return false } return s >= SemVer(major: major, minor: minor, patch: patch) diff --git a/scarf/Packages/ScarfCore/Tests/ScarfCoreTests/HermesCapabilitiesTests.swift b/scarf/Packages/ScarfCore/Tests/ScarfCoreTests/HermesCapabilitiesTests.swift index ab2824a..929d350 100644 --- a/scarf/Packages/ScarfCore/Tests/ScarfCoreTests/HermesCapabilitiesTests.swift +++ b/scarf/Packages/ScarfCore/Tests/ScarfCoreTests/HermesCapabilitiesTests.swift @@ -202,4 +202,26 @@ import Foundation #expect(caps.hasKanbanDiagnostics) #expect(caps.hasGoogleChatPlatform) } + + // MARK: - isV013OrLater convenience predicate + + @Test func isV013OrLater_v013HostTrue() { + let caps = HermesCapabilities.parseLine("Hermes Agent v0.13.0 (2026.5.7)") + #expect(caps.isV013OrLater) + } + + @Test func isV013OrLater_v012HostFalse() { + let caps = HermesCapabilities.parseLine("Hermes Agent v0.12.0 (2026.4.30)") + #expect(!caps.isV013OrLater) + } + + @Test func isV013OrLater_emptyFalse() { + let caps = HermesCapabilities.empty + #expect(!caps.isV013OrLater) + } + + @Test func isV013OrLater_v014HostTrue() { + let caps = HermesCapabilities.parseLine("Hermes Agent v0.14.0 (2026.7.1)") + #expect(caps.isV013OrLater) + } }