cask "yuanbao" do version "2.87.10.602,f9046313163f5a38e2610278c52199c9" sha256 "caec1d4908ba32cef75219125a8de7b5a85b6634fad039307cd5dd0d8c99708b" url "https://cdn-hybrid-prod.hunyuan.tencent.com/Desktop/official/#{version.csv.second}/yuanbao_#{version.csv.first}_universal.dmg" name "Yuanbao" desc "Tencent AI Assistant with Hunyuan and DeepSeek LLMs" homepage "https://yuanbao.tencent.com/" livecheck do url "https://yuanbao.tencent.com/api/info/public/general" regex(%r{/official/(\h+)/yuanbao[._-]v?(\d+(?:\.\d+)+)[._-]universal\.dmg}i) strategy :json do |json, regex| match = json.dig("pcDownloadUrl", "mac")&.match(regex) next if match.blank? "#{match[2]},#{match[1]}" end end auto_updates true depends_on :macos app "元宝.app" uninstall quit: "com.tencent.yuanbao" zap trash: [ "~/Library/Application Support/com.tencent.yuanbao", "~/Library/Caches/com.tencent.yuanbao", "~/Library/Containers/com.tencent.yuanbao", "~/Library/HTTPStorages/com.tencent.yuanbao", "~/Library/HTTPStorages/com.tencent.yuanbao.binarycookies", "~/Library/Preferences/com.tencent.yuanbao.plist", "~/Library/WebKit/com.tencent.yuanbao", ] end