From 4191d05fdac76373577393e585b1143d55bff788 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 17:39:21 +0000 Subject: [PATCH 1/2] Windows: the first build's errors fixed (Swift 6.4 on Windows), version 0.9.15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Windows' own calls answer with a plain Bool in Swift 6.4, so `.boolValue` is gone (Linux/WindowsCalls.swift). - The QR code's text rows are joined strings: `String(row.map { … })` could be read two ways there. - zlib's `uLong` is 32 bits on Windows: the gzip bound is asked with that type. Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01EE8zWAb9NE9fkNfceGiwqR --- Android/build.sh | 2 +- App/QRCode.swift | 2 +- App/StatusJSON.swift | 2 +- Linux/Compression.swift | 2 +- Linux/WindowsCalls.swift | 8 ++++---- Linux/kde/app/AppVersion.js | 2 +- Linux/kde/mock/machines.json | 2 +- Linux/kde/mock/settings.json | 2 +- Linux/kde/plasmoid/metadata.json | 2 +- build-library-app.sh | 2 +- scripts/package-flatpak.sh | 2 +- scripts/package-linux.sh | 2 +- scripts/package-service.sh | 2 +- scripts/package.sh | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Android/build.sh b/Android/build.sh index 76d8a966..4e142d10 100755 --- a/Android/build.sh +++ b/Android/build.sh @@ -24,7 +24,7 @@ platform=${ANDROID_PLATFORM:-35} jar=$sdk/platforms/android-$platform/android.jar [ -f "$jar" ] || { echo "No $jar: install the platform with sdkmanager \"platforms;android-$platform\"." >&2; exit 1; } tools=$(ls -d "$sdk"/build-tools/* | sort -V | tail -1) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.15} IFS=. read -r major minor patch <<<"$version.0.0" code=$((major * 10000 + minor * 100 + ${patch%%[^0-9]*})) diff --git a/App/QRCode.swift b/App/QRCode.swift index f825dbdf..fa9b8e14 100644 --- a/App/QRCode.swift +++ b/App/QRCode.swift @@ -50,7 +50,7 @@ enum QRCode { /// The code as text rows of "1" (dark) and "0", for JSON. static func rows(_ text: String) -> [String]? { - encode(text)?.map { row in String(row.map { $0 ? "1" : "0" }) } + encode(text)?.map { row in row.map { $0 ? "1" : "0" }.joined() } } /// The code drawn with half blocks for a terminal, two rows to a line, with a quiet zone of two modules diff --git a/App/StatusJSON.swift b/App/StatusJSON.swift index 1d45e6b6..ae5ff2e1 100644 --- a/App/StatusJSON.swift +++ b/App/StatusJSON.swift @@ -440,7 +440,7 @@ struct LocalResponse { extension StatusReport { /// Tokenmeter's version. The Mac app reads it from its Info.plist, which build-library-app.sh writes; the /// Linux service has no Info.plist, so it uses `releaseVersion`. Keep that in step with the build scripts. - static let releaseVersion = "0.9.14" + static let releaseVersion = "0.9.15" static var appVersion: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? releaseVersion } diff --git a/Linux/Compression.swift b/Linux/Compression.swift index 043bd236..2e07d1a3 100644 --- a/Linux/Compression.swift +++ b/Linux/Compression.swift @@ -15,7 +15,7 @@ enum Gzip { return nil } defer { deflateEnd(&stream) } - var packed = Data(count: Int(deflateBound(&stream, UInt(data.count)))) + var packed = Data(count: Int(deflateBound(&stream, uLong(data.count)))) let capacity = packed.count let status: Int32 = data.withUnsafeBytes { source in packed.withUnsafeMutableBytes { target in diff --git a/Linux/WindowsCalls.swift b/Linux/WindowsCalls.swift index ca0cdba3..eb219e04 100644 --- a/Linux/WindowsCalls.swift +++ b/Linux/WindowsCalls.swift @@ -25,7 +25,7 @@ enum WindowsCalls { static func memory() -> Memory? { var status = MEMORYSTATUSEX() status.dwLength = DWORD(MemoryLayout.size) - guard GlobalMemoryStatusEx(&status).boolValue else { return nil } + guard GlobalMemoryStatusEx(&status) else { return nil } let gib = 1_073_741_824.0 // The page file figures count physical memory too: what is beyond it is the page file's own. let pageTotal = max(0, Double(status.ullTotalPageFile) - Double(status.ullTotalPhys)) @@ -43,7 +43,7 @@ enum WindowsCalls { var idle = FILETIME() var kernel = FILETIME() var user = FILETIME() - guard GetSystemTimes(&idle, &kernel, &user).boolValue else { return nil } + guard GetSystemTimes(&idle, &kernel, &user) else { return nil } // Kernel time includes the idle time. let idleSeconds = seconds(idle) return ProcessorTime(idle: idleSeconds, busy: max(0, seconds(kernel) - idleSeconds) + seconds(user)) @@ -55,7 +55,7 @@ enum WindowsCalls { var exited = FILETIME() var kernel = FILETIME() var user = FILETIME() - guard GetProcessTimes(GetCurrentProcess(), &created, &exited, &kernel, &user).boolValue else { return 0 } + guard GetProcessTimes(GetCurrentProcess(), &created, &exited, &kernel, &user) else { return 0 } return seconds(kernel) + seconds(user) } @@ -63,7 +63,7 @@ enum WindowsCalls { static func diskSpace(_ path: String) -> (free: Double, total: Double)? { var free = ULARGE_INTEGER() var total = ULARGE_INTEGER() - let found = path.withCString(encodedAs: UTF16.self) { GetDiskFreeSpaceExW($0, &free, &total, nil).boolValue } + let found = path.withCString(encodedAs: UTF16.self) { GetDiskFreeSpaceExW($0, &free, &total, nil) } guard found else { return nil } return (Double(free.QuadPart), Double(total.QuadPart)) } diff --git a/Linux/kde/app/AppVersion.js b/Linux/kde/app/AppVersion.js index 1d09cd58..171afd28 100644 --- a/Linux/kde/app/AppVersion.js +++ b/Linux/kde/app/AppVersion.js @@ -3,4 +3,4 @@ // update keeps saying the version it is, while the service reports its own (backend.snapshot.version). // scripts/package-linux.sh and package-flatpak.sh write it from the package's version; keep it in step with // StatusReport.releaseVersion when bumping (a unit test checks it). -var version = "0.9.14" +var version = "0.9.15" diff --git a/Linux/kde/mock/machines.json b/Linux/kde/mock/machines.json index af14fa11..6ea44471 100644 --- a/Linux/kde/mock/machines.json +++ b/Linux/kde/mock/machines.json @@ -7,7 +7,7 @@ "report": { "schema": 1, "app": "Tokenmeter", - "version": "0.9.14", + "version": "0.9.15", "host": "studio", "chip": "Apple M3 Ultra", "time": "2026-11-13T19:00:00Z", diff --git a/Linux/kde/mock/settings.json b/Linux/kde/mock/settings.json index db3cba17..a9e8e599 100644 --- a/Linux/kde/mock/settings.json +++ b/Linux/kde/mock/settings.json @@ -15,7 +15,7 @@ "addresses": [ "192.168.1.20" ], - "version": "0.9.14", + "version": "0.9.15", "shareHistory": false, "footprint": { "cpuPercent": 0.4, diff --git a/Linux/kde/plasmoid/metadata.json b/Linux/kde/plasmoid/metadata.json index 8a841141..947738b6 100644 --- a/Linux/kde/plasmoid/metadata.json +++ b/Linux/kde/plasmoid/metadata.json @@ -7,7 +7,7 @@ "Icon": "tokenmeter", "Category": "System Information", "License": "Apache-2.0", - "Version": "0.9.14", + "Version": "0.9.15", "Website": "https://github.com/tokenmeter1/Tokenmeter" }, "X-Plasma-API-Minimum-Version": "6.0", diff --git a/build-library-app.sh b/build-library-app.sh index 00b486a0..d2809eb8 100755 --- a/build-library-app.sh +++ b/build-library-app.sh @@ -18,7 +18,7 @@ for word in "$@"; do esac done app="$project_dir/Tokenmeter.app" -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.15} build=${APP_BUILD:-1} # SwiftUI's @State is a compiler macro in the macOS 26 SDK. The Command Line Tools ship that SDK without diff --git a/scripts/package-flatpak.sh b/scripts/package-flatpak.sh index 35ab0f6f..765cbc36 100755 --- a/scripts/package-flatpak.sh +++ b/scripts/package-flatpak.sh @@ -7,7 +7,7 @@ # Needs flatpak and flatpak-builder; the KDE runtime and SDK are fetched from Flathub. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.15} arch=$(uname -m) id=io.github.tokenmeter1.tokenmeter name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh index d1f72f1c..2b763281 100755 --- a/scripts/package-linux.sh +++ b/scripts/package-linux.sh @@ -4,7 +4,7 @@ # and install.sh. Needs the Swift toolchain; run it on Linux. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.15} arch=$(uname -m) name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-service.sh b/scripts/package-service.sh index 70427745..49b04cf7 100755 --- a/scripts/package-service.sh +++ b/scripts/package-service.sh @@ -18,7 +18,7 @@ # On a Mac, SIGN_IDENTITY signs the program with a Developer ID; without it the program is ad-hoc signed. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.14} +version=${APP_VERSION:-0.9.15} case "$(uname -s)" in Darwin) os=macos ;; Linux) os=linux ;; diff --git a/scripts/package.sh b/scripts/package.sh index d5af922a..faa91b62 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -16,7 +16,7 @@ set -euo pipefail project_dir=${0:A:h:h} app="$project_dir/Tokenmeter.app" dist="$project_dir/dist" -export APP_VERSION=${APP_VERSION:-0.9.14} +export APP_VERSION=${APP_VERSION:-0.9.15} identity=${SIGN_IDENTITY:-} profile=${NOTARY_PROFILE:-} From c39f14952d1333856f624b75b126443bef3e376f Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 17:40:07 +0000 Subject: [PATCH 2/2] Version 0.9.17 (0.9.15 and 0.9.16 are taken by other changes) Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01EE8zWAb9NE9fkNfceGiwqR --- Android/build.sh | 2 +- App/StatusJSON.swift | 2 +- Linux/kde/app/AppVersion.js | 2 +- Linux/kde/mock/machines.json | 2 +- Linux/kde/mock/settings.json | 2 +- Linux/kde/plasmoid/metadata.json | 2 +- build-library-app.sh | 2 +- scripts/package-flatpak.sh | 2 +- scripts/package-linux.sh | 2 +- scripts/package-service.sh | 2 +- scripts/package.sh | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Android/build.sh b/Android/build.sh index 4e142d10..e0e6eed7 100755 --- a/Android/build.sh +++ b/Android/build.sh @@ -24,7 +24,7 @@ platform=${ANDROID_PLATFORM:-35} jar=$sdk/platforms/android-$platform/android.jar [ -f "$jar" ] || { echo "No $jar: install the platform with sdkmanager \"platforms;android-$platform\"." >&2; exit 1; } tools=$(ls -d "$sdk"/build-tools/* | sort -V | tail -1) -version=${APP_VERSION:-0.9.15} +version=${APP_VERSION:-0.9.17} IFS=. read -r major minor patch <<<"$version.0.0" code=$((major * 10000 + minor * 100 + ${patch%%[^0-9]*})) diff --git a/App/StatusJSON.swift b/App/StatusJSON.swift index ae5ff2e1..09998a0d 100644 --- a/App/StatusJSON.swift +++ b/App/StatusJSON.swift @@ -440,7 +440,7 @@ struct LocalResponse { extension StatusReport { /// Tokenmeter's version. The Mac app reads it from its Info.plist, which build-library-app.sh writes; the /// Linux service has no Info.plist, so it uses `releaseVersion`. Keep that in step with the build scripts. - static let releaseVersion = "0.9.15" + static let releaseVersion = "0.9.17" static var appVersion: String { Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? releaseVersion } diff --git a/Linux/kde/app/AppVersion.js b/Linux/kde/app/AppVersion.js index 171afd28..b7053a36 100644 --- a/Linux/kde/app/AppVersion.js +++ b/Linux/kde/app/AppVersion.js @@ -3,4 +3,4 @@ // update keeps saying the version it is, while the service reports its own (backend.snapshot.version). // scripts/package-linux.sh and package-flatpak.sh write it from the package's version; keep it in step with // StatusReport.releaseVersion when bumping (a unit test checks it). -var version = "0.9.15" +var version = "0.9.17" diff --git a/Linux/kde/mock/machines.json b/Linux/kde/mock/machines.json index 6ea44471..67086821 100644 --- a/Linux/kde/mock/machines.json +++ b/Linux/kde/mock/machines.json @@ -7,7 +7,7 @@ "report": { "schema": 1, "app": "Tokenmeter", - "version": "0.9.15", + "version": "0.9.17", "host": "studio", "chip": "Apple M3 Ultra", "time": "2026-11-13T19:00:00Z", diff --git a/Linux/kde/mock/settings.json b/Linux/kde/mock/settings.json index a9e8e599..c2fd0931 100644 --- a/Linux/kde/mock/settings.json +++ b/Linux/kde/mock/settings.json @@ -15,7 +15,7 @@ "addresses": [ "192.168.1.20" ], - "version": "0.9.15", + "version": "0.9.17", "shareHistory": false, "footprint": { "cpuPercent": 0.4, diff --git a/Linux/kde/plasmoid/metadata.json b/Linux/kde/plasmoid/metadata.json index 947738b6..94e1afe9 100644 --- a/Linux/kde/plasmoid/metadata.json +++ b/Linux/kde/plasmoid/metadata.json @@ -7,7 +7,7 @@ "Icon": "tokenmeter", "Category": "System Information", "License": "Apache-2.0", - "Version": "0.9.15", + "Version": "0.9.17", "Website": "https://github.com/tokenmeter1/Tokenmeter" }, "X-Plasma-API-Minimum-Version": "6.0", diff --git a/build-library-app.sh b/build-library-app.sh index d2809eb8..9ea0dbc4 100755 --- a/build-library-app.sh +++ b/build-library-app.sh @@ -18,7 +18,7 @@ for word in "$@"; do esac done app="$project_dir/Tokenmeter.app" -version=${APP_VERSION:-0.9.15} +version=${APP_VERSION:-0.9.17} build=${APP_BUILD:-1} # SwiftUI's @State is a compiler macro in the macOS 26 SDK. The Command Line Tools ship that SDK without diff --git a/scripts/package-flatpak.sh b/scripts/package-flatpak.sh index 765cbc36..ca9bc7b7 100755 --- a/scripts/package-flatpak.sh +++ b/scripts/package-flatpak.sh @@ -7,7 +7,7 @@ # Needs flatpak and flatpak-builder; the KDE runtime and SDK are fetched from Flathub. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.15} +version=${APP_VERSION:-0.9.17} arch=$(uname -m) id=io.github.tokenmeter1.tokenmeter name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh index 2b763281..25ed87ff 100755 --- a/scripts/package-linux.sh +++ b/scripts/package-linux.sh @@ -4,7 +4,7 @@ # and install.sh. Needs the Swift toolchain; run it on Linux. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.15} +version=${APP_VERSION:-0.9.17} arch=$(uname -m) name="Tokenmeter-$version-linux-$arch" diff --git a/scripts/package-service.sh b/scripts/package-service.sh index 49b04cf7..b7242cd3 100755 --- a/scripts/package-service.sh +++ b/scripts/package-service.sh @@ -18,7 +18,7 @@ # On a Mac, SIGN_IDENTITY signs the program with a Developer ID; without it the program is ad-hoc signed. set -eu project_dir=$(cd "$(dirname "$0")/.." && pwd) -version=${APP_VERSION:-0.9.15} +version=${APP_VERSION:-0.9.17} case "$(uname -s)" in Darwin) os=macos ;; Linux) os=linux ;; diff --git a/scripts/package.sh b/scripts/package.sh index faa91b62..16bc2d12 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -16,7 +16,7 @@ set -euo pipefail project_dir=${0:A:h:h} app="$project_dir/Tokenmeter.app" dist="$project_dir/dist" -export APP_VERSION=${APP_VERSION:-0.9.15} +export APP_VERSION=${APP_VERSION:-0.9.17} identity=${SIGN_IDENTITY:-} profile=${NOTARY_PROFILE:-}