Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

feat(apps): show each computer's Codync version and update it from the phone

leepokai76609e20752f
diff --git a/apps/android/WhatsNew.md b/apps/android/WhatsNew.md
index 9345e624..e4fcb25b 100644
--- a/apps/android/WhatsNew.md
+++ b/apps/android/WhatsNew.md
@@ -12,7 +12,9 @@ else a generic "Bug fixes and improvements" line. Delete old sections.
### zh-Hant
- Agent、模型、推理強度與 Fast mode 整合成可收合的精簡設定;每個 Bot 可獨立保存推理強度,Default 也會顯示預設值。
- 「設定」現在是「狀態」右邊的獨立分頁,只放這支手機自己的設定。電腦的擴充套件、語音、螢幕、推送通知與連線,都移到「管理電腦」裡那台電腦的卡片上。
+- 電腦卡片最下方的「Codync」會顯示那台電腦的版本;有新版時可以直接點「更新」。
### en-US
- Agent, model, reasoning effort and Fast mode now share compact, expandable settings. Each bot keeps its own effort preference, with the default level shown.
- Settings is now its own tab, next to State, with only this phone's own settings. Your computer's Extensions, Voice chat, Screen, Push notifications and Connection are on its card in Manage computers.
+- Codync at the bottom of the card shows the version your computer runs; when a newer one is out, tap Update.
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt
index 22edcaca..9210aed4 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreHostUpdate.kt
@@ -1,5 +1,6 @@
package com.codync.android
+import com.codync.android.core.AppVersion
import com.codync.android.core.VersionMismatch
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.flow.update
@@ -28,20 +29,58 @@ internal data class HostUpdateNotice(val detail: String, val offersUpdate: Boole
internal fun hostUpdateNotice(host: String, mismatch: VersionMismatch.UpdateHost, os: String?, canUpdate: Boolean,
update: HostUpdate?, now: Long): HostUpdateNotice {
- if (update.updating(now)) return HostUpdateNotice("Updating Codync on $host. This takes a few minutes.", false)
+ if (update.updating(now)) return HostUpdateNotice(updatingText(host), false)
val needs = "$host runs Codync ${mismatch.version}; this app needs ${mismatch.minimum} or newer."
- if (!canUpdate) return HostUpdateNotice("$needs " + when (os) {
- "macos" -> "Open Codync on that Mac and choose Check for Updates."
- "linux" -> "Run codync-host update there."
- else -> "Update Codync on that computer."
- }, false)
+ if (!canUpdate) return HostUpdateNotice("$needs ${howToUpdate(os)}", false)
return HostUpdateNotice(when (update) {
is HostUpdate.Failed -> "$needs ${update.message}"
- is HostUpdate.Requested -> "$needs $host didn't finish updating. Try again, or update Codync on that computer."
+ is HostUpdate.Requested -> "$needs ${notUpdatedText(host)}"
null -> needs
}, true)
}
+private fun updatingText(host: String) = "Updating Codync on $host. This takes a few minutes."
+private fun notUpdatedText(host: String) = "$host didn't finish updating. Try again, or update Codync on that computer."
+
+/** How to update Codync on a computer this app can't update (iOS `UpdateNeededText.how`). */
+private fun howToUpdate(os: String?) = when (os) {
+ "macos" -> "Open Codync on that Mac and choose Check for Updates."
+ "linux" -> "Run codync-host update there."
+ else -> "Update Codync on that computer."
+}
+
+/**
+ * The Codync row on the computer's card in Computer management: the version it runs, and an update when
+ * one is due, a newer release or a version too old for this app (iOS `HostVersionLine`). `detail` is
+ * sentences, each its own phrase to translate.
+ */
+internal data class HostVersionLine(val version: String, val detail: List<String>, val warns: Boolean = false,
+ val action: String? = null, val updating: Boolean = false)
+
+/** `latest` is the latest release the computer found (null while it doesn't know: then no verdict). */
+internal fun hostVersionLine(version: String, latest: String?, mismatch: VersionMismatch?, canUpdate: Boolean,
+ update: HostUpdate?, host: String, os: String?, now: Long): HostVersionLine {
+ if (update.updating(now)) return HostVersionLine(version, listOf(updatingText(host)), updating = true)
+ val minimum = (mismatch as? VersionMismatch.UpdateHost)?.minimum
+ val available = latest?.takeIf { AppVersion.isBelow(version, it) }
+ val due = minimum?.let { "This app needs $it or newer." } ?: available?.let { "$it available" }
+ ?: return HostVersionLine(version, if (latest == null) emptyList() else listOf("Up to date"))
+ if (!canUpdate) return HostVersionLine(version, listOf(due, howToUpdate(os)), warns = minimum != null)
+ return when (update) {
+ is HostUpdate.Failed -> HostVersionLine(version, listOf(update.message), warns = true, action = "Try again")
+ is HostUpdate.Requested -> HostVersionLine(version, listOf(notUpdatedText(host)), warns = true, action = "Try again")
+ null -> HostVersionLine(version, listOf(due), warns = minimum != null, action = "Update")
+ }
+}
+
+/** This computer's Codync row; null until its `hello` arrives. */
+internal fun AppState.hostVersionLine(now: Long): HostVersionLine? {
+ val hello = hello ?: return null
+ val version = hello.text("version") ?: return null
+ val host = hello.text("name") ?: computers.firstOrNull()?.name ?: "your computer"
+ return hostVersionLine(version, hello.text("latestVersion"), mismatch, canUpdateHost, hostUpdate, host, hello.text("os"), now)
+}
+
/** Asks a computer that's behind to install the latest release (the update card's Update now). */
fun AppStore.requestHostUpdate() = action("hostUpdate") {
mutableState.update { it.copy(hostUpdate = HostUpdate.Requested(System.currentTimeMillis())) }
diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt b/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
index e08f313f..9a5bb4ce 100644
--- a/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
+++ b/apps/android/app/src/main/kotlin/com/codync/android/ComputersView.kt
@@ -128,6 +128,9 @@ private fun CardRows.computerRows(state: AppState, store: AppStore, inAccount: B
}
}
row { ConnectionRow(state.computers.first(), store) }
+ if (state.connection is LinkState.Ready) state.hostVersionLine(System.currentTimeMillis())?.let { line ->
+ row { CodyncVersionRow(line, store::requestHostUpdate) }
+ }
if (state.isStale && !inAccount) row { RowLabel("Remove", "trash", Palette.danger, modifier = Modifier.plainButton(action = actions.remove)) }
}
@@ -164,6 +167,23 @@ private fun CardRows.computerRows(state: AppState, store: AppStore, inAccount: B
}
/** How this phone reaches the computer: the short name on the row, the whole route in the menu. */
+/** The Codync the computer runs, and its update when one is due (iOS `CodyncVersionRow`). */
+@Composable private fun CodyncVersionRow(line: HostVersionLine, update: () -> Unit) {
+ Row(Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp)) {
+ Box(Modifier.width(26.dp), contentAlignment = Alignment.Center) { Symbol("arrow.down.circle", size = 20.dp, tint = Palette.text) }
+ Column(Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(3.dp)) {
+ Row(horizontalArrangement = Arrangement.spacedBy(8.dp)) {
+ Text("Codync", style = Type.body, color = Palette.text)
+ Text(line.version, style = Type.body, color = Palette.secondary)
+ }
+ if (line.detail.isNotEmpty()) Text(line.detail.map { tr(it) }.joinToString(" "), style = Type.footnote,
+ color = if (line.warns) Palette.warning else Palette.secondary)
+ }
+ if (line.updating) Spinner(16.dp)
+ line.action?.let { PrimaryButton(it, action = update) }
+ }
+}
+
@Composable private fun ConnectionRow(computer: Computer, store: AppStore) {
DropdownMenu({ ConnectionRoute.entries.map { route -> MenuItem(routeTitle(route, computer.cloud), icon = route.icon, selected = route == computer.route) { store.setRoute(route) } } },
Modifier.fillMaxWidth(), label = "Connection") {
diff --git a/apps/android/app/src/test/kotlin/com/codync/android/HostUpdateNoticeTest.kt b/apps/android/app/src/test/kotlin/com/codync/android/HostUpdateNoticeTest.kt
index edb6da62..4e6e774d 100644
--- a/apps/android/app/src/test/kotlin/com/codync/android/HostUpdateNoticeTest.kt
+++ b/apps/android/app/src/test/kotlin/com/codync/android/HostUpdateNoticeTest.kt
@@ -30,4 +30,26 @@ class HostUpdateNoticeTest {
assertEquals(HostUpdateNotice("$needs Open Codync on that Mac and choose Check for Updates.", false), notice(false, null))
assertEquals(HostUpdateNotice("$needs Run codync-host update there.", false), notice(false, null, "linux"))
}
+
+ // The Codync row on the computer's card in Computer management (iOS `HostVersionLine`).
+ private fun line(latest: String?, mismatch: VersionMismatch? = null, canUpdate: Boolean = true, update: HostUpdate? = null) =
+ hostVersionLine("2.28.0", latest, mismatch, canUpdate, update, "Mini", "macos", now)
+
+ @Test fun theCodyncRowOffersANewerReleaseOrSaysItsCurrent() {
+ assertEquals(HostVersionLine("2.28.0", listOf("Up to date")), line("2.28.0"))
+ assertEquals(listOf("Up to date"), line("2.27.0").detail)
+ // A computer that doesn't know the latest release makes no claim.
+ assertEquals(HostVersionLine("2.28.0", emptyList()), line(null))
+ assertEquals(HostVersionLine("2.28.0", listOf("2.29.0 available"), action = "Update"), line("2.29.0"))
+ assertEquals(HostVersionLine("2.28.0", listOf("2.29.0 available", "Open Codync on that Mac and choose Check for Updates.")),
+ line("2.29.0", canUpdate = false))
+ assertEquals(HostVersionLine("2.28.0", listOf("Updating Codync on Mini. This takes a few minutes."), updating = true),
+ line("2.29.0", update = HostUpdate.Requested(now)))
+ }
+
+ @Test fun aComputerTooOldOrAnUpdateThatDidntTakeIsAProblem() {
+ assertEquals(HostVersionLine("2.28.0", listOf("This app needs 2.26.0 or newer."), warns = true, action = "Update"), line(null, behind))
+ val busy = "A bot is working on this computer. Update it once the bot is done."
+ assertEquals(HostVersionLine("2.28.0", listOf(busy), warns = true, action = "Try again"), line("2.29.0", update = HostUpdate.Failed(busy)))
+ }
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift b/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift
index a6db2232..2d8b19d5 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift
+++ b/apps/ios/Kit/Sources/CodyncKit/Models/Models.swift
@@ -239,6 +239,8 @@ public struct Hello: Codable, Sendable {
public var cloud: String?
/// `installHostUpdate` can update this computer from here (missing from older hosts: it can't).
public var canUpdate: Bool?
+ /// The latest release the computer found; nil while unknown (development builds, older hosts).
+ public var latestVersion: String?
}
public struct DirListing: Codable, Sendable {
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
index 4aad0e4c..ca9db6c2 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/de.json
@@ -1242,5 +1242,14 @@
"Rate on the App Store": "Im App Store bewerten",
"Search agents": "Agenten suchen",
"Search models": "Modelle suchen",
- "No results": "Keine Ergebnisse"
+ "No results": "Keine Ergebnisse",
+ "Up to date": "Aktuell",
+ "{version} available": "{version} verfügbar",
+ "This app needs {version} or newer.": "Diese App benötigt {version} oder neuer.",
+ "Update": "Aktualisieren",
+ "Updating Codync on {name}. This takes a few minutes.": "Codync auf {name} wird aktualisiert. Das dauert ein paar Minuten.",
+ "Open Codync on that Mac and choose Check for Updates.": "Öffne Codync auf diesem Mac und wähle Check for Updates.",
+ "Run codync-host update there.": "Führe dort codync-host update aus.",
+ "Update Codync on that computer.": "Aktualisiere Codync auf diesem Computer.",
+ "{name} didn't finish updating. Try again, or update Codync on that computer.": "{name} wurde nicht fertig aktualisiert. Versuche es erneut oder aktualisiere Codync auf diesem Computer."
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
index b310750f..c4e24d01 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/es.json
@@ -1242,5 +1242,14 @@
"Rate on the App Store": "Valorar en el App Store",
"Search agents": "Buscar agentes",
"Search models": "Buscar modelos",
- "No results": "Sin resultados"
+ "No results": "Sin resultados",
+ "Up to date": "Actualizado",
+ "{version} available": "{version} disponible",
+ "This app needs {version} or newer.": "Esta app necesita {version} o una versión más reciente.",
+ "Update": "Actualizar",
+ "Updating Codync on {name}. This takes a few minutes.": "Actualizando Codync en {name}. Tarda unos minutos.",
+ "Open Codync on that Mac and choose Check for Updates.": "Abre Codync en ese Mac y elige Check for Updates.",
+ "Run codync-host update there.": "Ejecuta codync-host update en esa computadora.",
+ "Update Codync on that computer.": "Actualiza Codync en esa computadora.",
+ "{name} didn't finish updating. Try again, or update Codync on that computer.": "{name} no terminó de actualizarse. Vuelve a intentarlo o actualiza Codync en esa computadora."
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
index fe588e21..0d60e08a 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/fr.json
@@ -1242,5 +1242,14 @@
"Rate on the App Store": "Noter sur l’App Store",
"Search agents": "Rechercher des agents",
"Search models": "Rechercher des modèles",
- "No results": "Aucun résultat"
+ "No results": "Aucun résultat",
+ "Up to date": "À jour",
+ "{version} available": "{version} disponible",
+ "This app needs {version} or newer.": "Cette app nécessite {version} ou une version plus récente.",
+ "Update": "Mettre à jour",
+ "Updating Codync on {name}. This takes a few minutes.": "Mise à jour de Codync sur {name}. Cela prend quelques minutes.",
+ "Open Codync on that Mac and choose Check for Updates.": "Ouvrez Codync sur ce Mac et choisissez Check for Updates.",
+ "Run codync-host update there.": "Lancez codync-host update sur cet ordinateur.",
+ "Update Codync on that computer.": "Mettez à jour Codync sur cet ordinateur.",
+ "{name} didn't finish updating. Try again, or update Codync on that computer.": "{name} n'a pas terminé la mise à jour. Réessayez ou mettez à jour Codync sur cet ordinateur."
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
index 5b6e0245..15ec8741 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ja.json
@@ -1242,5 +1242,14 @@
"Rate on the App Store": "App Store で評価",
"Search agents": "エージェントを検索",
"Search models": "モデルを検索",
- "No results": "結果がありません"
+ "No results": "結果がありません",
+ "Up to date": "最新です",
+ "{version} available": "{version} が利用可能",
+ "This app needs {version} or newer.": "このアプリには {version} 以降が必要です。",
+ "Update": "アップデート",
+ "Updating Codync on {name}. This takes a few minutes.": "{name} の Codync をアップデート中です。数分かかります。",
+ "Open Codync on that Mac and choose Check for Updates.": "その Mac で Codync を開き、Check for Updates を選んでください。",
+ "Run codync-host update there.": "そのコンピュータで codync-host update を実行してください。",
+ "Update Codync on that computer.": "そのコンピュータで Codync をアップデートしてください。",
+ "{name} didn't finish updating. Try again, or update Codync on that computer.": "{name} のアップデートが完了しませんでした。もう一度試すか、そのコンピュータで Codync をアップデートしてください。"
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
index 9812e303..148f60bc 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/ko.json
@@ -1242,5 +1242,14 @@
"Rate on the App Store": "App Store에서 평가하기",
"Search agents": "에이전트 검색",
"Search models": "모델 검색",
- "No results": "결과 없음"
+ "No results": "결과 없음",
+ "Up to date": "최신 버전",
+ "{version} available": "{version} 사용 가능",
+ "This app needs {version} or newer.": "이 앱에는 {version} 이상이 필요합니다.",
+ "Update": "업데이트",
+ "Updating Codync on {name}. This takes a few minutes.": "{name}에서 Codync를 업데이트하는 중입니다. 몇 분 정도 걸립니다.",
+ "Open Codync on that Mac and choose Check for Updates.": "해당 Mac에서 Codync를 열고 Check for Updates를 선택하세요.",
+ "Run codync-host update there.": "해당 컴퓨터에서 codync-host update를 실행하세요.",
+ "Update Codync on that computer.": "해당 컴퓨터에서 Codync를 업데이트하세요.",
+ "{name} didn't finish updating. Try again, or update Codync on that computer.": "{name}의 업데이트가 완료되지 않았습니다. 다시 시도하거나 해당 컴퓨터에서 Codync를 업데이트하세요."
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
index 0fe6590d..05b71d0c 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hans.json
@@ -1242,5 +1242,14 @@
"Rate on the App Store": "在 App Store 评分",
"Search agents": "搜索智能体",
"Search models": "搜索模型",
- "No results": "没有结果"
+ "No results": "没有结果",
+ "Up to date": "已是最新版本",
+ "{version} available": "有新版本 {version}",
+ "This app needs {version} or newer.": "这个 App 需要 {version} 或更高版本。",
+ "Update": "更新",
+ "Updating Codync on {name}. This takes a few minutes.": "正在更新 {name} 上的 Codync,需要几分钟。",
+ "Open Codync on that Mac and choose Check for Updates.": "请在那台 Mac 上打开 Codync,选择 Check for Updates。",
+ "Run codync-host update there.": "请在那台电脑上运行 codync-host update。",
+ "Update Codync on that computer.": "请在那台电脑上更新 Codync。",
+ "{name} didn't finish updating. Try again, or update Codync on that computer.": "{name} 没有完成更新。请再试一次,或在那台电脑上更新 Codync。"
}
diff --git a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
index 234c6c70..d03f89a5 100644
--- a/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
+++ b/apps/ios/Kit/Sources/CodyncKit/Resources/Languages/zh-Hant.json
@@ -1242,5 +1242,14 @@
"Rate on the App Store": "在 App Store 評分",
"Search agents": "搜尋智慧體",
"Search models": "搜尋模型",
- "No results": "沒有結果"
+ "No results": "沒有結果",
+ "Up to date": "已是最新版本",
+ "{version} available": "有新版 {version}",
+ "This app needs {version} or newer.": "這個 App 需要 {version} 或更新的版本。",
+ "Update": "更新",
+ "Updating Codync on {name}. This takes a few minutes.": "正在更新 {name} 上的 Codync,需要幾分鐘。",
+ "Open Codync on that Mac and choose Check for Updates.": "請在那台 Mac 上打開 Codync,選擇 Check for Updates。",
+ "Run codync-host update there.": "請在那台電腦上執行 codync-host update。",
+ "Update Codync on that computer.": "請在那台電腦上更新 Codync。",
+ "{name} didn't finish updating. Try again, or update Codync on that computer.": "{name} 沒有完成更新。請再試一次,或在那台電腦上更新 Codync。"
}
diff --git a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift
index 97408930..b1c55db5 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Store/BotStore+HostUpdate.swift
@@ -18,7 +18,45 @@ public enum HostUpdateOffer: Equatable, Sendable {
case unavailable
}
+/// The Codync row on a computer's card in Computer management: the version it runs, and an update
+/// when one is due (a newer release, or a version too old for this app).
+public struct HostVersionLine: Equatable, Sendable {
+ public var version: String
+ /// Sentences, each its own phrase to translate.
+ public var detail: [String]
+ /// The detail is a problem: the computer is too old for this app, or its update didn't take.
+ public var warns = false
+ /// The button that asks the computer to update; nil when this phone can't, or it's updating.
+ public var action: String?
+ public var updating = false
+
+ /// `latest` is the latest release the computer found (nil while it doesn't know: then no verdict).
+ public static func make(version: String, latest: String?, mismatch: VersionMismatch?, offer: HostUpdateOffer,
+ host: String, os: String?) -> HostVersionLine {
+ if offer == .updating { return HostVersionLine(version: version, detail: [UpdateNeededText.updating(host: host)], updating: true) }
+ let minimum: String? = if case let .updateHost(_, minimum) = mismatch { minimum } else { nil }
+ let available = latest.flatMap { AppVersion.isBelow(version, $0) ? $0 : nil }
+ let due = minimum.map { "This app needs \($0) or newer." } ?? available.map { "\($0) available" }
+ guard let due else { return HostVersionLine(version: version, detail: latest == nil ? [] : ["Up to date"]) }
+ switch offer {
+ case let .available(last?):
+ return HostVersionLine(version: version, detail: [UpdateNeededText.notUpdated(last, host: host)], warns: true, action: "Try again")
+ case .available(nil):
+ return HostVersionLine(version: version, detail: [due], warns: minimum != nil, action: "Update")
+ case .unavailable, .updating:
+ return HostVersionLine(version: version, detail: [due, UpdateNeededText.how(os: os)], warns: minimum != nil)
+ }
+ }
+}
+
extension BotStore {
+ /// This computer's Codync row; nil until its `hello` arrives.
+ public var hostVersionLine: HostVersionLine? {
+ guard let hello else { return nil }
+ return .make(version: hello.version, latest: hello.latestVersion, mismatch: mismatch,
+ offer: hostUpdateOffer(), host: hostName, os: hello.os)
+ }
+
/// How long an update may take before the notice offers it again.
static let hostUpdateWait: TimeInterval = 10 * 60
/// While it updates, `hello` is asked this often, so the notice goes away soon after.
diff --git a/apps/ios/Kit/Sources/CodyncUI/UpdateNeededCard.swift b/apps/ios/Kit/Sources/CodyncUI/UpdateNeededCard.swift
index 97aee0c2..1bd7086f 100644
--- a/apps/ios/Kit/Sources/CodyncUI/UpdateNeededCard.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/UpdateNeededCard.swift
@@ -107,13 +107,17 @@ public enum UpdateNeededText {
let runs = hostVersion.map { "\(host) runs Codync \($0) and" } ?? host
return "\(runs) needs this app to be \(minimum) or newer. Your chats are safe on the computer."
case let .updateHost(version, minimum):
- let how = switch os {
- case "macos": "Open Codync on that Mac and choose Check for Updates."
- case "linux": "Run codync-host update there."
- default: "Update Codync on that computer."
- }
let needs = "\(host) runs Codync \(version); this app needs \(minimum) or newer."
- return instructions ? "\(needs) \(how)" : needs
+ return instructions ? "\(needs) \(how(os: os))" : needs
+ }
+ }
+
+ /// How to update Codync on a computer this app can't update.
+ public static func how(os: String?) -> String {
+ switch os {
+ case "macos": "Open Codync on that Mac and choose Check for Updates."
+ case "linux": "Run codync-host update there."
+ default: "Update Codync on that computer."
}
}
diff --git a/apps/ios/Kit/Tests/CodyncUITests/HostUpdateTests.swift b/apps/ios/Kit/Tests/CodyncUITests/HostUpdateTests.swift
index 0085e293..85df6b09 100644
--- a/apps/ios/Kit/Tests/CodyncUITests/HostUpdateTests.swift
+++ b/apps/ios/Kit/Tests/CodyncUITests/HostUpdateTests.swift
@@ -39,3 +39,32 @@ import Testing
store.hello?.canUpdate = nil
#expect(store.hostUpdateOffer() == .unavailable)
}
+
+// The Codync row on a computer's card in Computer management.
+
+@Test func theCodyncRowOffersANewerReleaseOrSaysItsCurrent() {
+ let line = { (latest: String?, offer: HostUpdateOffer) in
+ HostVersionLine.make(version: "2.28.0", latest: latest, mismatch: nil, offer: offer, host: "Mac", os: "macos")
+ }
+ #expect(line("2.28.0", .available(last: nil)) == HostVersionLine(version: "2.28.0", detail: ["Up to date"]))
+ #expect(line("2.27.0", .available(last: nil)).detail == ["Up to date"])
+ // A computer that doesn't know the latest release makes no claim.
+ #expect(line(nil, .available(last: nil)) == HostVersionLine(version: "2.28.0", detail: []))
+ #expect(line("2.29.0", .available(last: nil)) == HostVersionLine(version: "2.28.0", detail: ["2.29.0 available"], action: "Update"))
+ // Not from here: it says how, on that computer.
+ #expect(line("2.29.0", .unavailable).detail == ["2.29.0 available", "Open Codync on that Mac and choose Check for Updates."])
+ #expect(line("2.29.0", .unavailable).action == nil)
+ #expect(line("2.29.0", .updating) == HostVersionLine(version: "2.28.0", detail: ["Updating Codync on Mac. This takes a few minutes."],
+ updating: true))
+}
+
+@Test func aComputerTooOldOrAnUpdateThatDidntTakeIsAProblem() {
+ let behind = VersionMismatch.updateHost(version: "2.20.0", minimum: "2.26.0")
+ let old = HostVersionLine.make(version: "2.20.0", latest: nil, mismatch: behind, offer: .available(last: nil), host: "Mac", os: "linux")
+ #expect(old == HostVersionLine(version: "2.20.0", detail: ["This app needs 2.26.0 or newer."], warns: true, action: "Update"))
+ let manual = HostVersionLine.make(version: "2.20.0", latest: "2.29.0", mismatch: behind, offer: .unavailable, host: "Mac", os: "linux")
+ #expect(manual.detail == ["This app needs 2.26.0 or newer.", "Run codync-host update there."] && manual.warns)
+ let failed = HostVersionLine.make(version: "2.28.0", latest: "2.29.0", mismatch: nil,
+ offer: .available(last: .failed("A bot is working on this computer.")), host: "Mac", os: "macos")
+ #expect(failed == HostVersionLine(version: "2.28.0", detail: ["A bot is working on this computer."], warns: true, action: "Try again"))
+}
diff --git a/apps/ios/Views/ComputersView.swift b/apps/ios/Views/ComputersView.swift
index 482ea542..b2f9ca95 100644
--- a/apps/ios/Views/ComputersView.swift
+++ b/apps/ios/Views/ComputersView.swift
@@ -174,6 +174,9 @@ private struct ComputerRows: View {
}
.toggleStyle(.codync)
connection
+ if store.connection == .online, let line = store.hostVersionLine {
+ CodyncVersionRow(line: line, update: store.requestHostUpdate)
+ }
if accounts.isStale(store.computer.id), inAccount == nil {
Button(action: remove) { RowLabel("Remove", systemImage: "trash", tint: Palette.danger) }
.buttonStyle(.plain)
@@ -273,6 +276,37 @@ private struct ComputerRows: View {
}
}
+/// The Codync a computer runs, and its update when one is due (`HostVersionLine`).
+private struct CodyncVersionRow: View {
+ let line: HostVersionLine
+ let update: () -> Void
+
+ var body: some View {
+ HStack(spacing: 12) {
+ Image(systemName: "arrow.down.circle").font(.system(size: 17)).frame(width: 26)
+ VStack(alignment: .leading, spacing: 3) {
+ HStack(spacing: 8) {
+ Text(verbatim: "Codync")
+ Text(verbatim: line.version).foregroundStyle(Palette.secondary).monospacedDigit()
+ }
+ if !line.detail.isEmpty {
+ Text(line.detail.map { L10n.tr($0) }.joined(separator: " "))
+ .font(.footnote)
+ .foregroundStyle(line.warns ? Palette.warning : Palette.secondary)
+ .fixedSize(horizontal: false, vertical: true)
+ }
+ }
+ .frame(maxWidth: .infinity, alignment: .leading)
+ if line.updating { Spinner(size: 16) }
+ if let action = line.action {
+ Button(L10n.tr(action), action: update).buttonStyle(.primary)
+ }
+ }
+ .foregroundStyle(Palette.text)
+ .animation(Motion.layout, value: line)
+ }
+}
+
/// A computer in the account that this iPhone can't use yet.
private struct AccountComputerRow: View {
let computer: CloudComputer
diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.md
index 4dd43a6d..2e8f7887 100644
--- a/apps/ios/WhatsNew.md
+++ b/apps/ios/WhatsNew.md
@@ -12,8 +12,10 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o
- Agent、模型、推理強度與 Fast mode 整合成可收合的精簡設定;每個 Bot 可獨立保存推理強度,Default 也會顯示預設值。
- 評分邀請只會在你使用一段時間、看完 Bot 的成果並回到列表後出現,不會在開啟 App 時打擾你。也可以隨時從設定前往 App Store 評分。
- 「設定」現在是「狀態」右邊的獨立分頁,只放這支 iPhone 自己的設定。每台電腦的擴充套件、語音、螢幕、推送通知與連線,都移到「管理電腦」裡那台電腦的卡片上;推送通知可以逐台電腦開關。
+- 電腦卡片最下方的「Codync」會顯示那台電腦的版本;有新版時可以直接點「更新」,從手機叫那台電腦更新。
### en-US
- Agent, model, reasoning effort and Fast mode now share compact, expandable settings. Each bot keeps its own effort preference, with the default level shown.
- Rating invitations wait until you have used Codync for a while, viewed a bot's result, and returned to the list. You can also rate Codync anytime from Settings.
- Settings is now its own tab, next to State, with only this iPhone's own settings. Each computer's Extensions, Voice chat, Screen, Push notifications and Connection are on its card in Manage computers, and push can be turned off for each computer.
+- Codync at the bottom of a computer's card shows the version it runs; when a newer one is out, tap Update to have that computer update from your phone.
diff --git a/docs/design/ui-conventions.md b/docs/design/ui-conventions.md
index 22b07684..0bb66aa0 100644
--- a/docs/design/ui-conventions.md
+++ b/docs/design/ui-conventions.md
@@ -48,7 +48,7 @@ Usage row shows no number; it opens Settings' Usage page with the same per-provi
## Account menu and Settings (desktop)
-The chat window's account menu copies Grok Bot's: Usage, Get Codync for mobile, Support, Settings, then the signed-in account and Sign out. Everything else is a page of **Settings**, laid out like ChatGPT's desktop settings (references in `reference/chatgpt-settings-*.png`): a sidebar of pages under small group labels (Personal: General, Voice chat, Usage; This Mac, or This computer on Linux: Computers, Updates) and a large page title over the page's sections. Manage computers and approval badges lead to the Computers page. The phone apps' Settings tab (iPhone and Android), to the right of State in the same bar, holds only what belongs to the phone itself: appearance, language, thinking details, notification permission, usage analytics and Start over. Anything that belongs to one computer lives in Computer management, the sheet Manage computers and links open: one card per computer with its name and status, then Extensions, Voice chat (its keys live on that computer), Screen, Push notifications (whether that computer alerts this phone) and Connection as rows (Connection shows the route's short name; its menu has the whole route), then Hidden bots, and Pair a computer in a card of its own. Source: `apps/desktop/src/renderer/views/settings/SettingsView.tsx`, account menu in `apps/desktop/src/renderer/views/PanelMenus.tsx`.
+The chat window's account menu copies Grok Bot's: Usage, Get Codync for mobile, Support, Settings, then the signed-in account and Sign out. Everything else is a page of **Settings**, laid out like ChatGPT's desktop settings (references in `reference/chatgpt-settings-*.png`): a sidebar of pages under small group labels (Personal: General, Voice chat, Usage; This Mac, or This computer on Linux: Computers, Updates) and a large page title over the page's sections. Manage computers and approval badges lead to the Computers page. The phone apps' Settings tab (iPhone and Android), to the right of State in the same bar, holds only what belongs to the phone itself: appearance, language, thinking details, notification permission, usage analytics and Start over. Anything that belongs to one computer lives in Computer management, the sheet Manage computers and links open: one card per computer with its name and status, then Extensions, Voice chat (its keys live on that computer), Screen, Push notifications (whether that computer alerts this phone), Connection and Codync as rows (Connection shows the route's short name, its menu the whole route; Codync shows the version the computer runs, whether it's up to date, and **Update** when a newer release is out or this app needs one), then Hidden bots, and Pair a computer in a card of its own. Source: `apps/desktop/src/renderer/views/settings/SettingsView.tsx`, account menu in `apps/desktop/src/renderer/views/PanelMenus.tsx`.
## iPhone and desktop code
diff --git a/docs/guides/updates.md b/docs/guides/updates.md
index 3d4e2a01..33c38ccd 100644
--- a/docs/guides/updates.md
+++ b/docs/guides/updates.md
@@ -188,7 +188,12 @@ The API operations `hostUpdateStatus`, `checkHostUpdate` and `setHostAutomaticUp
require a local connection, including an SSH tunnel.
`installHostUpdate` is also open to paired devices: it's what a client's **Update now**
-calls when a computer is too old for it. `hello.canUpdate` says whether it can work there:
+calls when a computer is too old for it, and what **Update** on the computer's Codync row in
+the phones' Computer management calls. That row compares `hello.version` with
+`hello.latestVersion`, the latest release `update::release_watch` looks up at start and every
+6 hours whatever installed the host (release builds only; null until a lookup succeeds, and on
+Windows, which has no host update manifests), so it says *Up to date*, *2.29.0 available*, or
+nothing when the computer doesn't know. `hello.canUpdate` says whether it can work there:
a release host the installed service runs, or one the desktop app bundles while that app is
open (it polls `/health?app=true` every 5 seconds; `canUpdate` needs a poll in the last 15).
Both cases are decided in one place, `update::route`. A standalone host schedules the
diff --git a/docs/reference/compatibility.md b/docs/reference/compatibility.md
index c4e8de09..095f6dfe 100644
--- a/docs/reference/compatibility.md
+++ b/docs/reference/compatibility.md
@@ -32,7 +32,7 @@ reason to lock someone out.
|---|---|---|
| Notice | `UpdateNeededCard` above the computer's bots and in place of the composer; status reads *Needs update* | *needs update* in the status line, with the reason |
| Update this app | iPhone: App Store page. Desktop: electron-updater check (`apps/desktop/src/main/updates.ts`). Android: text only | Text only |
-| Update the host | Desktop on macOS and Windows, its own computer: the bundled host is reinstalled (**Update now**). Any computer whose `hello` has `canUpdate` (the Linux desktop's own too): **Update now** calls `installHostUpdate` ([updates](../guides/updates.md#standalone-hosts-on-linux-and-macos)), and the notice reads *Updating Codync on …* until the host comes back newer, or for 10 minutes; then it offers the update again with why. Otherwise: instructions for that computer | `^k` → Check for updates |
+| Update the host | Desktop on macOS and Windows, its own computer: the bundled host is reinstalled (**Update now**). Any computer whose `hello` has `canUpdate` (the Linux desktop's own too): **Update now** calls `installHostUpdate` ([updates](../guides/updates.md#standalone-hosts-on-linux-and-macos)), and the notice reads *Updating Codync on …* until the host comes back newer, or for 10 minutes; then it offers the update again with why. Otherwise: instructions for that computer. The phones also offer it, and any newer release (`hello.latestVersion`), on the Codync row of the computer's card in Computer management | `^k` → Check for updates |
| Sync while mismatched | Stopped; `hello` is asked again every 30 s (5 s while an update asked from here runs) and on every reconnect | Continues; sending is blocked |
Drafts are kept while sending is blocked. A host update restarts the host, so the reconnect
diff --git a/host/src/api/host.rs b/host/src/api/host.rs
index 932392d1..a686469d 100644
--- a/host/src/api/host.rs
+++ b/host/src/api/host.rs
@@ -68,6 +68,8 @@ pub(super) async fn call(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value
"minApp": crate::compat::MIN_APP,
// Whether `installHostUpdate` can update this computer, from here or a phone.
"canUpdate": tokio::task::spawn_blocking(crate::update::installable).await?,
+ // The latest release, so a phone can say whether this computer is current (null: unknown).
+ "latestVersion": crate::update::latest_version(),
"os": std::env::consts::OS,
"device": tokio::task::spawn_blocking(crate::service::device).await?,
"home": dirs::home_dir().map(|p| p.to_string_lossy().into_owned()),
diff --git a/host/src/background.rs b/host/src/background.rs
index 45e28122..2fca63e9 100644
--- a/host/src/background.rs
+++ b/host/src/background.rs
@@ -23,6 +23,7 @@ pub fn start(hub: &Arc<Hub>) {
});
tokio::spawn(usage::poll(hub.clone()));
tokio::spawn(update::automatic_loop(hub.clone()));
+ tokio::spawn(update::release_watch());
tokio::spawn(screen::serve_helpers(hub.screen.clone()));
tokio::spawn(relay::run(hub.clone()));
#[cfg(target_os = "linux")]
diff --git a/host/src/update/mod.rs b/host/src/update/mod.rs
index ef3e4d7a..b8f57705 100644
--- a/host/src/update/mod.rs
+++ b/host/src/update/mod.rs
@@ -6,14 +6,14 @@ mod release;
#[cfg(test)]
mod tests;
-use crate::{hub::Hub, service};
+use crate::{LockExt as _, hub::Hub, service};
use anyhow::{Context, Result, ensure};
use serde::{Deserialize, Serialize};
use serde_json::{Value, json};
use std::{
path::Path,
sync::{
- Arc,
+ Arc, Mutex,
atomic::{AtomicI64, Ordering},
},
time::Duration,
@@ -95,6 +95,30 @@ fn route(executable: &Path) -> Result<Route> {
Ok(Route::App)
}
+/// The latest release `release_watch` found, whatever installed this host.
+static LATEST: Mutex<Option<String>> = Mutex::new(None);
+
+/// The latest release for this platform (`hello.latestVersion`), so a phone can say whether this computer is
+/// current and offer the update; None until a lookup succeeds, and always on development builds.
+pub fn latest_version() -> Option<String> {
+ LATEST.locked().clone()
+}
+
+/// Looks up the latest release at start and every 6 hours, for `latest_version`. Release builds only:
+/// a development host never offers a release.
+pub async fn release_watch() {
+ if crate::environment::Environment::current() != crate::environment::Environment::Main {
+ return;
+ }
+ loop {
+ match release::latest().await {
+ Ok(release) => *LATEST.locked() = Some(release.version),
+ Err(error) => tracing::debug!(error = format!("{error:#}"), "latest release lookup failed"),
+ }
+ tokio::time::sleep(Duration::from_hours(6)).await;
+ }
+}
+
/// Whether `installHostUpdate` can update this computer (`hello.canUpdate`).
pub fn installable() -> bool {
service::current_exe().is_ok_and(|executable| route(&executable).is_ok())
diff --git a/host/tests/fixtures/wire-shape.json b/host/tests/fixtures/wire-shape.json
index b31e0496..b9d9912b 100644
--- a/host/tests/fixtures/wire-shape.json
+++ b/host/tests/fixtures/wire-shape.json
@@ -189,6 +189,7 @@
"hello.device": "string",
"hello.home": "string",
"hello.hostId": "string",
+ "hello.latestVersion": "null",
"hello.minApp": "string",
"hello.name": "string",
"hello.os": "string",
diff --git a/web/content/docs/updates.mdx b/web/content/docs/updates.mdx
index 5db235bc..66b8b251 100644
--- a/web/content/docs/updates.mdx
+++ b/web/content/docs/updates.mdx
@@ -45,6 +45,10 @@ codync-host update --auto off # turn automatic updates off (on to turn them bac
A manual update won't interrupt a bot that's working unless you add `--force`; interrupted bots pick up their sessions again. In the terminal UI, press `^k` and choose **Check for updates**.
+## Update a computer from your phone
+
+On the iPhone or Android, tap the connection status at the top of the Bots tab (such as **1 connected**), choose **Manage computers**, and look at **Codync** at the bottom of the computer's card. It shows the version that computer runs, and says **Up to date** or which newer version is available. Tap **Update** to have the computer download it and restart into it, usually within a few minutes; the row says it's updating until the computer is back. It's the same update as **Update now** on the notice [below](#when-the-phone-and-computer-versions-dont-match), with the same rules: a computer doesn't update while a bot is working on it, and a Mac or Windows computer updates this way while the Codync app is open on it. When the computer can't be updated from your phone, the row says how to do it there.
+
## The iPhone app
The iPhone app updates through the App Store. Every iPhone release goes through Apple's App Review first, so the App Store version can be a day or more behind the desktop app and the host. When a newer version is out, a card at the top of the bot list tells you which version is available, with an **Update** button that opens the App Store. You can dismiss it.