Files
zeekay 3de1e92a15 Bump to 2026.5.12; finish HanzoBot* → Bot* identifier sweep so build passes
The big rebrand left a residue of HanzoBot* identifiers inside camelCase
compounds (resolveHanzoBotAgentDir, HanzoBotPackageRoot, hanzoBotRoot,
HanzoBotTmpDir, …) that the canonical bot-root.ts / tmp-bot-dir.ts had
always exported as Bot* / bot*. The earlier \b-anchored sweep missed
them because the H is mid-identifier with no word boundary. Replace
HanzoBot(?=[A-Z][a-z]) → Bot (and hanzoBot equivalent) everywhere, plus
HanzoBotKit → BotKit (the on-disk module is apps/shared/BotKit).

Also one stray pi-tools.ts type narrowing (senderId is string|null but
the target wants string|undefined) — coerce with ?? undefined.

pnpm build → ✔ Build complete in 7s.
2026-05-12 20:41:07 -07:00

22 lines
655 B
Swift

import Foundation
import BotKit
public enum TailscaleNetwork {
public static func isTailnetIPv4(_ address: String) -> Bool {
let parts = address.split(separator: ".")
guard parts.count == 4 else { return false }
let octets = parts.compactMap { Int($0) }
guard octets.count == 4 else { return false }
let a = octets[0]
let b = octets[1]
return a == 100 && b >= 64 && b <= 127
}
public static func detectTailnetIPv4() -> String? {
for entry in NetworkInterfaceIPv4.addresses() where self.isTailnetIPv4(entry.ip) {
return entry.ip
}
return nil
}
}