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.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(android): call the lead from the app icon, share text to a bot, and match the iPhone's settings
leepokai42b13440a9cf
diff --git a/apps/android/WhatsNew.md b/apps/android/WhatsNew.mdindex 59c851df..9506a148 100644--- a/apps/android/WhatsNew.md+++ b/apps/android/WhatsNew.md@@ -15,15 +15,15 @@ else a generic "Bug fixes and improvements" line. Delete old sections.- 新對話交接卡片可以保留原對話或編輯交接內容。- 通話以來電樣式通知,可直接掛斷或靜音;新增 Claude Code、Codex 用量小工具。- 設定加入「在 Google Play 評分」與「回報問題」;有新版本時會提醒。+- 長按 App 圖示選「Talk to Codync」直接和 lead bot 通話;從其他 App 分享文字可送到 bot 的訊息框。- 掃描配對 QR code 更容易對焦。- 自訂圖示現在只用在 bot 上;只用 Cursor CLI 登入時也能看到 Cursor 用量。### en-US-- Pair more than one computer, with a heading per computer and a filter in Bots.-- Bot details gain a Memory page.-- Dictate in the message box, on device or with your own OpenAI or Gemini key.-- Keep or edit a fresh conversation's handoff.+- Pair several computers, each with a heading and filter in Bots.+- Bot details gain a Memory page; keep or edit a new chat's handoff.+- Dictate on device or with your own OpenAI or Gemini key.- Calls show as Android calls; new Claude Code and Codex usage widgets.-- Rate on Google Play, Report an issue, and an update note.-- The pairing camera focuses more easily.+- Talk to Codync, an icon shortcut, calls your lead; share text to a bot.+- Rate on Google Play, Report an issue, update notes; easier QR focus.- Custom icons are for bots only; Cursor usage shows with a CLI sign-in.diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/ChatLayoutTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/ChatLayoutTest.ktindex 8840828e..bb8f7e47 100644--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/ChatLayoutTest.kt+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/ChatLayoutTest.kt@@ -130,10 +130,10 @@ class ChatLayoutTest {hello = buildJsonObject { put("version", ARTIFACTS_HOST) })compose.runOnUiThread { compose.activity.setContent { Hosted { ChatScreen(state, store, {}) } } }compose.onNode(chatTitle).performClick()- // Details first, with the routines; no Memory on Android until the read-only memory screen is ported.+ // Details first, with the routines; then Library, Memory and Settings, as on the iPhone.compose.onNode(hasText("Details") and isSelected()).assertIsDisplayed()compose.onNodeWithText("Library").assertIsDisplayed()- compose.onNodeWithText("Memory").assertDoesNotExist()+ compose.onNodeWithText("Memory").assertIsDisplayed()// The sheet merges plain text into itself, so the heading is found unmerged.compose.onNodeWithText("Routines", useUnmergedTree = true).assertExists()compose.onNodeWithText("Settings").performClick()diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/ComputerRosterTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/ComputerRosterTest.ktindex 8730c8e9..7ee95e69 100644--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/ComputerRosterTest.kt+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/ComputerRosterTest.kt@@ -62,4 +62,21 @@ class ComputerRosterTest {assertNull(accounts.store(mac.id))assertNotNull(accounts.store(linux.id))}++ @Test fun aChatWhoseComputerIsRemovedSaysSoUntilBack() = compose.withPreviewAccounts(mac, linux) { accounts ->+ runBlocking(Dispatchers.Main) {+ requireNotNull(accounts.store(linux.id)).openBot("Linux bot")+ accounts.close(linux.id)+ }+ assertTrue(accounts.state.value.removedChat)+ compose.setContent {+ Hosted {+ MainTabs(app.copy(computers = listOf(mac), removedChat = true), listOf(state(mac, "Mac bot")), accounts, {}, {}, {}, {}, {},+ { _, _ -> }, {}, covered = true) {}+ }+ }+ compose.onNodeWithText("This computer was removed").assertIsDisplayed()+ compose.onNodeWithContentDescription("Back").performClick()+ compose.waitUntil(5_000) { !accounts.state.value.removedChat }+ }}diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/LayoutTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/LayoutTest.ktindex e367f26d..c43f3917 100644--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/LayoutTest.kt+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/LayoutTest.kt@@ -45,12 +45,21 @@ class LayoutTest {compose.onNode(hasSetTextAction() and hasText("Name your bot")).assertIsDisplayed()compose.onNodeWithContentDescription("Close").performClick()compose.onNodeWithContentDescription("Create").assertDoesNotExist()- compose.onNode(tab("State")).performClick().assertIsSelected()+ // The State tab's widget previews never stop moving: step the clock by hand there.+ compose.mainClock.autoAdvance = false+ compose.onNode(tab("State")).performClick()+ compose.mainClock.advanceTimeBy(1_000)+ compose.onNode(tab("State")).assertIsSelected()compose.onNodeWithText("Widget").assertIsSelected()- compose.onNodeWithText("Choose your widget").performScrollTo().assertIsDisplayed()+ compose.onNodeWithText("Choose your widget").performScrollTo()+ compose.mainClock.advanceTimeBy(500)+ compose.onNodeWithText("Choose your widget").assertIsDisplayed()snapshot("widget-gallery")compose.onNodeWithText("Bot 1").assertDoesNotExist()- compose.onNode(tab("Bots")).performClick().assertIsSelected()+ compose.onNode(tab("Bots")).performClick()+ compose.mainClock.advanceTimeBy(1_000)+ compose.mainClock.autoAdvance = true+ compose.onNode(tab("Bots")).assertIsSelected()compose.onNodeWithText("Bot 5").assertIsDisplayed()}diff --git a/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.kt b/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.ktindex 387d4899..cd9994a5 100644--- a/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.kt+++ b/apps/android/app/src/androidTest/kotlin/com/codync/android/ScreenPresentationTest.kt@@ -93,8 +93,10 @@ class ScreenPresentationTest {val close = compose.onNodeWithContentDescription("Close").assertIsDisplayed().fetchSemanticsNode().boundsInRootassertTrue(title.right < save.left && save.right <= close.left)val screen = compose.onRoot().fetchSemanticsNode().boundsInRoot- listOf("Agent: Claude", "Workspace", "Permissions: Approve automatically").forEach { label ->- val row = compose.onNodeWithContentDescription(label).performScrollTo().assertIsDisplayed().fetchSemanticsNode().boundsInRoot+ // The agent row reads "<agent> · <model>"; the pickers say their name and value.+ listOf(hasText("Default", substring = true) and hasClickAction(), hasContentDescription("Workspace", substring = true),+ hasContentDescription("Permissions", substring = true)).forEach { matcher ->+ val row = compose.onNode(matcher).performScrollTo().assertIsDisplayed().fetchSemanticsNode().boundsInRootassertTrue(row.left >= screen.left && row.right <= screen.right)}compose.onNode(hasText("Notifications") and isToggleable()).performScrollTo().assertIsOn().performClick().assertIsOff()diff --git a/apps/android/app/src/main/AndroidManifest.xml b/apps/android/app/src/main/AndroidManifest.xmlindex 5a57e203..3168f979 100644--- a/apps/android/app/src/main/AndroidManifest.xml+++ b/apps/android/app/src/main/AndroidManifest.xml@@ -85,6 +85,12 @@<action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter>+ <!-- Text shared from another app goes to a bot's message box (the iPhone's Send Text to Bot). -->+ <intent-filter>+ <action android:name="android.intent.action.SEND" />+ <category android:name="android.intent.category.DEFAULT" />+ <data android:mimeType="text/plain" />+ </intent-filter><intent-filter><action android:name="android.intent.action.VIEW" /><category android:name="android.intent.category.DEFAULT" />diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.kt b/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.ktindex 01e0493b..65730cde 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AccountStore.kt@@ -76,8 +76,9 @@ class AccountStore(application: Application) : AndroidViewModel(application) {val computers = withContext(Dispatchers.IO) { local.computers() }val complete = withContext(Dispatchers.IO) { local.setupComplete() }val last = withContext(Dispatchers.IO) { local.lastComputer() }+ val lead = withContext(Dispatchers.IO) { local.shortcutLead() }mutableState.update { AccountContext(contextId = local.referenceId, generation = it.generation + 1, account = it.account,- computers = computers, lastComputerId = last, tasks = PushPreferences.tasks(getApplication()),+ computers = computers, lastComputerId = last, shortcutLeadComputer = lead, tasks = PushPreferences.tasks(getApplication()),setupComplete = complete || computers.isNotEmpty() || userId != null) }// A computer that can't open (damaged drafts) is reported; the others, the cloud and the widgets go on.for (computer in computers) try { open(computer) }@@ -87,6 +88,7 @@ class AccountStore(application: Application) : AndroidViewModel(application) {withContext(Dispatchers.IO) { AttachmentFiles(getApplication(), local.directory).retainPending(stores.value.flatMap { it.pendingFiles() }) }if (userId != null) configureCloud(userId)mutableState.update { it.copy(loading = false) }+ LiveShortcut.publish(getApplication(), computers.isNotEmpty())observeWidgets(requireNotNull(widgetOwner))refreshCloud()} catch (error: CancellationException) { throw error }@@ -125,6 +127,7 @@ class AccountStore(application: Application) : AndroidViewModel(application) {val context = state.valueval store = AppStore(getApplication(), local, computer, context.contextId, context.generation, contextJob, ::saveComputer, opened = { opened ->for (other in stores.value) if (other !== opened) other.openBot(null)+ mutableState.update { it.copy(removedChat = false) }noteActive(opened.id)}, usageRead = ::publishUsage)store.open()@@ -136,7 +139,9 @@ class AccountStore(application: Application) : AndroidViewModel(application) {/** Forgets [id] here: its link, mirror and drafts; its bots and chats stay on the computer. */internal suspend fun close(id: String) {val store = store(id) ?: return+ val chatOpen = store.state.value.selectedBot != nullmutableStores.update { list -> list.filter { it.id != id } }+ if (chatOpen) mutableState.update { it.copy(removedChat = true) }store.retire()computerChanges.withLock {val computers = state.value.computers.filter { it.id != id }@@ -146,6 +151,7 @@ class AccountStore(application: Application) : AndroidViewModel(application) {DraftBook.delete(local.directory, id)}mutableState.update { it.copy(computers = computers) }+ LiveShortcut.publish(getApplication(), computers.isNotEmpty())}}@@ -155,6 +161,7 @@ class AccountStore(application: Application) : AndroidViewModel(application) {val computers = if (saved.any { it.id == computer.id }) saved.map { if (it.id == computer.id) computer else it } else saved + computerwithContext(Dispatchers.IO) { local.saveComputers(computers) }mutableState.update { it.copy(computers = computers) }+ LiveShortcut.publish(getApplication(), true)}/**@@ -186,6 +193,7 @@ class AccountStore(application: Application) : AndroidViewModel(application) {/** Opens a chat on its computer, closing the one open on another; null closes it. */fun openBot(ref: BotDestination?) {+ mutableState.update { it.copy(removedChat = false) }for (store in stores.value) store.openBot(if (store.id == ref?.computerId) ref.botId else null)}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreLinks.kt b/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreLinks.ktindex 6b7c280c..293cecc3 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreLinks.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AccountStoreLinks.kt@@ -97,6 +97,18 @@ fun AccountStore.openLink(uri: Uri) {}}+/** Text another app shared waits for a bot to go to (`ShareToBot`), once the account has loaded. */+fun AccountStore.share(text: String) {+ linkJob?.cancel()+ linkJob = viewModelScope.launch {+ withTimeoutOrNull(30_000) { activated() } ?: return@launch+ navigate(LinkPage.Bots)+ mutableState.update { it.copy(sharing = text) }+ }+}++fun AccountStore.finishSharing() = mutableState.update { it.copy(sharing = null) }+/** `codync://computers` and `codync://plugins`: Computer management, or the last active computer's extensions, over the roster. */fun AccountStore.openPage(page: LinkPage) {linkJob?.cancel()diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppState.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppState.ktindex 282ad890..a8ee5871 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AppState.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppState.kt@@ -29,6 +29,12 @@ data class AccountContext(val pairing: Boolean = false,/** This phone's computers, in the order it shows them. */val computers: List<Computer> = emptyList(),+ /** The computer whose lead "Talk to Codync" calls; null is Automatic (iOS `shortcutLeadComputer`). */+ val shortcutLeadComputer: String? = null,+ /** Text another app shared, waiting for a bot to go to. */+ val sharing: String? = null,+ /** The open chat's computer was removed: the chat's place shows that until Back (iOS `ChatScreen`). */+ val removedChat: Boolean = false,/** The computer the Usage sheet and widget show: the last one a chat was opened or sent on. */val lastComputerId: String? = null,val navigationRequest: Int = 0,@@ -62,6 +68,8 @@ data class AppState(val actualConnection: LinkState = LinkState.Connecting,/** The chat open on this computer; at most one computer has one (`AccountStore.openBot`). */val selectedBot: String? = null,+ /** A call to start in this bot's chat once it shows ("Talk to Codync"). */+ val callRequest: String? = null,val trace: Boolean = false,val busy: Set<String> = emptySet(),val historyComplete: Set<String> = emptySet(),diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreBots.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreBots.ktindex 9c98794b..ea2c1e8b 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreBots.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreBots.kt@@ -66,8 +66,16 @@ fun AppStore.saveBot(draft: BotDraft, onSaved: () -> Unit) = action("editor") {onSaved()}-/** A saved bot's settings from its details, saved as they're edited: the chat stays where it is. */-fun AppStore.saveSettings(draft: BotDraft) = command("updateBot", draft.body(), "settings:" + draft.id)+/** A saved bot's settings from its details, saved as they're edited; [done] gets the error, or null once it took. */+fun AppStore.saveSettings(draft: BotDraft, done: (String?) -> Unit) = action("settings:" + draft.id) {+ try {+ val result = ready().call("updateBot", draft.body())+ result.jsonObject["bot"]?.let { withContext(Dispatchers.IO) { requireNotNull(database).receive(HostClient.decode(it.jsonObject)) } }+ refresh()+ done(null)+ } catch (cancelled: CancellationException) { throw cancelled }+ catch (error: Exception) { done(error.message ?: "Couldn't save the changes.") }+}fun AppStore.saveGroup(draft: GroupDraft, onSaved: () -> Unit) = action("editor") {val payload = draft.body(state.value.bots)diff --git a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreChat.kt b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreChat.ktindex ce0bbaf3..991bb8be 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/AppStoreChat.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/AppStoreChat.kt@@ -17,6 +17,18 @@ fun AppStore.openBot(id: String?) {}fun AppStore.showTrace(show: Boolean) { mutableState.update { it.copy(trace = show) } }+/** Starts a call in [botId]'s chat once it shows; the chat takes it (`takeCallRequest`). */+fun AppStore.requestCall(botId: String) { mutableState.update { it.copy(callRequest = botId) } }+fun AppStore.takeCallRequest(botId: String): Boolean {+ if (state.value.callRequest != botId) return false+ mutableState.update { it.copy(callRequest = null) }+ return true+}++/** Puts [text] after what's in [botId]'s message box (text shared from another app). */+fun AppStore.appendDraft(botId: String, text: String) =+ editDraft(botId, com.codync.android.core.DictationText.join(state.value.drafts[botId]?.text.orEmpty(), text))+/** The chat being read (iOS `ReadingConversation`): the open one, still on screen under Full conversation. */internal val AppState.readingChats: List<String> get() = listOfNotNull(selectedBot)diff --git a/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.kt b/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.ktindex aa2ecd55..8fd9029c 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/BotDetailsView.kt@@ -60,10 +60,12 @@ internal data class DetailsRequest(val tab: DetailsTab = DetailsTab.Details, valval online = state.actualConnection is LinkState.Ready// Saves a moment after the last change, like the desktop inspector. Keyed on the saved bot too: an edit made while// the previous save was still out (and so skipped) is sent once that save lands.+ // What the last save said, shown on the page where it was made (iOS `saveError`), not over the app.+ var saveError by remember(bot.id) { mutableStateOf<String?>(null) }LaunchedEffect(draft, online, saved) {if (!online || !draft.isValid || draft == saved) return@LaunchedEffectdelay(600)- store.saveSettings(draft)+ store.saveSettings(draft) { saveError = it }}val tabs = listOfNotNull(DetailsTab.Details, DetailsTab.Library.takeIf { hasLibrary(state.hello?.text("version")) }, DetailsTab.Memory, DetailsTab.Settings)Box(Modifier.fillMaxSize().background(Palette.background)) {@@ -75,14 +77,14 @@ internal data class DetailsRequest(val tab: DetailsTab = DetailsTab.Details, valBox(Modifier.fillMaxWidth().padding(top = 20.dp)) {when (tab) {DetailsTab.Details -> Column(verticalArrangement = Arrangement.spacedBy(28.dp)) {- BotSettingsForm(state, store, draft, { draft = it }, FormPart.Often)+ BotSettingsForm(state, store, draft, { draft = it }, FormPart.Often, error = saveError)state.screen?.let { ComputerCard(it, draft.computer, online) { on -> draft = draft.copy(computer = on) } }RoutinesView(bot, state, store, routineId)LaunchedEffect(Unit) { routineId = null }}DetailsTab.Library -> LibraryView(bot, state, store, openArtifact)DetailsTab.Memory -> MemoryCard(bot.id, state, store)- DetailsTab.Settings -> BotSettingsForm(state, store, draft, { draft = it }, FormPart.Rarely)+ DetailsTab.Settings -> BotSettingsForm(state, store, draft, { draft = it }, FormPart.Rarely, error = saveError)}}}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.kt b/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.ktindex 2f0e30a3..d1b440f4 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/BotSettingsForm.kt@@ -38,7 +38,7 @@ internal enum class FormPart { All, Often, Rarely }/** Bot settings, in sections in the Settings style (`CardSection`), with the pickers they open. */@Composable internal fun BotSettingsForm(state: AppState, store: AppStore, draft: BotDraft, change: (BotDraft) -> Unit, part: FormPart,- modifier: Modifier = Modifier) {+ modifier: Modifier = Modifier, error: String? = state.error) {var folders by remember { mutableStateOf(false) }// The Avatar row unfolds the picker (iOS `pickingAvatar`).var pickingAvatar by remember { mutableStateOf(false) }@@ -62,7 +62,7 @@ internal enum class FormPart { All, Often, Rarely }notifyRow(draft, change); computerUseRow(state, draft, change); manageTeamRow(state, draft, change); reachRows(state, draft, change)}Plugins(state, draft, change) { viewingSkill = it }- state.error?.let { Text(it, style = Type.footnote, color = Palette.danger) }+ error?.let { Text(tr(it), style = Type.footnote, color = Palette.danger) }}FormPart.Often -> {CardSection("Instructions") { instructionsRow(draft, change) }@@ -71,6 +71,8 @@ internal enum class FormPart { All, Often, Rarely }agentRows(state, store, draft, change, bot) { addingFallback = true }if (!online) row { OfflineNote() }}+ // A save that didn't take, where it was made (iOS `saveError`).+ error?.let { Text(tr(it), style = Type.footnote, color = Palette.danger) }}FormPart.Rarely -> {CardSection("Profile") {@@ -81,6 +83,7 @@ internal enum class FormPart { All, Often, Rarely }CardSection("Workspace") { computerRow(state, online); placeRows(draft, change) { folders = true } }CardSection("Activity") { notifyRow(draft, change); manageTeamRow(state, draft, change); reachRows(state, draft, change) }Plugins(state, draft, change) { viewingSkill = it }+ error?.let { Text(tr(it), style = Type.footnote, color = Palette.danger) }}}}@@ -240,7 +243,7 @@ private fun CardRows.reachRows(state: AppState, draft: BotDraft, change: (BotDraval plugins = state.pluginsPluginToggles("Connectors", "No connectors yet. Add GitHub, Linear, Notion and more from Extensions.",plugins?.connectors.orEmpty().map { Triple(it.id, it.name, it.command ?: it.url.orEmpty()) },- draft.connectors ?: plugins?.connectors.orEmpty().map { it.id }, { change(draft.copy(connectors = it)) })+ draft.connectors.orEmpty(), { change(draft.copy(connectors = it)) })PluginToggles("Skills", "No skills yet. Get some from Extensions, or write your own.",plugins?.skills.orEmpty().map { Triple(it.id, it.name, it.description) }, draft.skills.orEmpty(), { change(draft.copy(skills = it)) }) { id ->plugins?.skills?.firstOrNull { it.id == id }?.let { viewSkill(SkillRef(it.id, it.name, it.description)) }diff --git a/apps/android/app/src/main/kotlin/com/codync/android/ChatScreen.kt b/apps/android/app/src/main/kotlin/com/codync/android/ChatScreen.ktindex 766be69c..23f86904 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/ChatScreen.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/ChatScreen.kt@@ -87,6 +87,8 @@ import com.kyant.shapes.Capsulevar connector by remember { mutableStateOf<MarketConnector?>(null) }val connect = ConnectionRequestActions({ id, item -> setupEntry = id; app = item }, { id, item -> setupEntry = id; connector = item })val startCall = rememberStartVoice(bot.id, state, store) { micDenied = true }+ // "Talk to Codync" asked for a call here.+ LaunchedEffect(state.callRequest) { if (state.voice == null && store.takeCallRequest(bot.id)) startCall() }val top = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()var composerHeight by remember { mutableIntStateOf(0) }val density = LocalDensity.currentdiff --git a/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt b/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.ktindex dd87eef4..0943c984 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/CodyncApp.kt@@ -130,6 +130,8 @@ private data class Editing<T>(val computerId: String, val draft: T)AnalyticsOnAppear(AnalyticsEvent.ScreenViewed(AnalyticsScreen.Pairing))PairingView(app, accounts, inModal = true)}+ // Text another app shared: which bot's box it goes to.+ CodyncSheet(app.sharing?.takeIf { root == Root.Tabs }, accounts::finishSharing) { text -> ShareToBot(text, states, accounts) }CodyncSheet(showUsage && !app.loading, { showUsage = false }) {AnalyticsOnAppear(AnalyticsEvent.ScreenViewed(AnalyticsScreen.Usage))UsageSheet(app, states, accounts)diff --git a/apps/android/app/src/main/kotlin/com/codync/android/LiveShortcut.kt b/apps/android/app/src/main/kotlin/com/codync/android/LiveShortcut.ktnew file mode 100644index 00000000..1971a7e7--- /dev/null+++ b/apps/android/app/src/main/kotlin/com/codync/android/LiveShortcut.kt@@ -0,0 +1,114 @@+package com.codync.android++import android.content.Context+import android.content.Intent+import androidx.compose.runtime.Composable+import androidx.core.content.pm.ShortcutInfoCompat+import androidx.core.content.pm.ShortcutManagerCompat+import androidx.core.graphics.drawable.IconCompat+import com.codync.android.core.Bot+import com.codync.android.core.BotDestination+import com.codync.android.core.LinkState+import com.codync.android.design.*+import kotlinx.coroutines.flow.first+import kotlinx.coroutines.flow.update+import kotlinx.coroutines.launch+import kotlinx.coroutines.withTimeoutOrNull++// Android's counterparts of the iPhone's Shortcuts actions (docs/features/ios-shortcuts.md): "Talk to Codync" in the+// app icon's shortcuts calls the lead bot like Open Live Mode, and text shared from another app goes to a bot's+// message box like Send Text to Bot with Open Chat on.++/** The app icon's "Talk to Codync" shortcut. */+internal object LiveShortcut {+ const val ACTION = "com.codync.android.action.TALK"++ /** Published while a computer is paired; the launcher keeps it until the next account without one. */+ fun publish(context: Context, paired: Boolean) {+ if (!paired) { ShortcutManagerCompat.removeDynamicShortcuts(context, listOf(ID)); return }+ val shortcut = ShortcutInfoCompat.Builder(context, ID).setShortLabel(context.getString(R.string.talk_shortcut))+ .setIcon(IconCompat.createWithResource(context, com.codync.android.design.R.drawable.sf_waveform))+ .setIntent(Intent(ACTION).setClass(context, MainActivity::class.java)).build()+ runCatching { ShortcutManagerCompat.pushDynamicShortcut(context, shortcut) }+ }++ private const val ID = "talk"+}++/** The lead the shortcut calls: the one on the computer picked in Settings, else the first computer's in the user's order that has one (iOS `ShortcutBotQuery.lead`). */+internal fun shortcutLead(computers: List<AppState>, chosen: String?): Pair<AppState, Bot>? {+ val leads = computers.mapNotNull { state -> state.bots.firstOrNull { it.lead && !it.deleted }?.let { state to it } }+ return leads.firstOrNull { it.first.computer.id == chosen } ?: leads.firstOrNull()+}++/**+ * Opens the lead's chat and starts a call once its computer is connected, as Open Live Mode without a bot does;+ * with no lead (deleted, not synced yet) it opens Bots to pick one, and an unreachable computer is an error.+ */+fun AccountStore.talkToLead() {+ linkJob?.cancel()+ linkJob = contextScope.launch {+ val ready = withTimeoutOrNull(30_000) { activated() } ?: return@launch+ val (state, lead) = shortcutLead(ready.computers.mapNotNull { store(it.id)?.state?.value }, ready.shortcutLeadComputer)+ ?: return@launch openPage(LinkPage.Bots)+ val store = store(state.computer.id) ?: return@launch+ openBot(BotDestination(ready.contextId, store.id, lead.id))+ val connected = withTimeoutOrNull(20_000) { store.state.first { it.actualConnection is LinkState.Ready } }+ if (connected == null) store.showError(java.io.IOException("Can't reach the computer. Check that it's on, then try again."))+ else store.requestCall(lead.id)+ }+}++/** Saved per account, like the iPhone's `shortcutLeadComputer`; null is Automatic. */+fun AccountStore.chooseShortcutLead(computerId: String?) {+ mutableState.update { it.copy(shortcutLeadComputer = computerId) }+ contextScope.launch(kotlinx.coroutines.Dispatchers.IO) { local.saveShortcutLead(computerId) }+}++/**+ * Settings' Shortcuts card (iOS `ShortcutLeadSettings`): which lead "Talk to Codync" calls, shown once more than one+ * computer has a lead. A computer whose lead is gone shows as Automatic, which is what the shortcut does then.+ */+@Composable internal fun ShortcutLeadSettings(app: AccountContext, states: List<AppState>, accounts: AccountStore) {+ val leads = states.mapNotNull { state -> state.bots.firstOrNull { it.lead && !it.deleted }?.let { state to it } }+ if (leads.size < 2) return+ val chosen = app.shortcutLeadComputer?.takeIf { id -> leads.any { it.first.computer.id == id } }.orEmpty()+ CardSection("Shortcuts", footer = "Talk to Codync, in the app icon's shortcuts, calls this lead. Automatic calls the lead of the first computer in your list.") {+ row {+ ValueRow("Lead to call") {+ ChoicePicker(chosen, listOf("" to tr("Automatic")) + leads.map { (state, bot) -> state.computer.id to "${bot.name} · ${state.hostName}" },+ { accounts.chooseShortcutLead(it.ifEmpty { null }) }, label = "Lead to call")+ }+ }+ }+}++/**+ * Text shared from another app (Android's share sheet): pick a bot and its chat opens with the text in its message+ * box, after anything typed there, for you to send.+ */+@Composable internal fun ShareToBot(text: String, states: List<AppState>, accounts: AccountStore) {+ val dismiss = LocalDismissModal.current+ androidx.compose.foundation.layout.Column {+ ModalHeader("Send to a bot")+ CardForm {+ CardSection(footer = "The message waits in the chat's box until you send it.") {+ row { androidx.compose.material3.Text(text, style = Type.footnote, color = Palette.secondary, maxLines = 4,+ overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis) }+ }+ for (state in states) {+ val bots = roster(state.bots).filter { it.kind != "group" || it.members.isNotEmpty() }+ if (bots.isNotEmpty()) CardSection(if (states.size > 1) state.hostName else null) {+ for (bot in bots) row {+ androidx.compose.foundation.layout.Box(androidx.compose.ui.Modifier.plainButton {+ accounts.store(state.computer.id)?.let { store -> store.appendDraft(bot.id, text) }+ accounts.openBot(BotDestination(state.contextId, state.computer.id, bot.id))+ accounts.finishSharing()+ dismiss()+ }) { BotRow(bot, state) }+ }+ }+ }+ }+ }+}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/LocalStore.kt b/apps/android/app/src/main/kotlin/com/codync/android/LocalStore.ktindex ae2a9c3b..29954384 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/LocalStore.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/LocalStore.kt@@ -77,6 +77,12 @@ class LocalStore(context: Context, val contextId: String = "local") {fun lastComputer(): String? = File(directory, "last-computer").takeIf { it.exists() }?.readText()?.takeIf { it.isNotBlank() }fun saveLastComputer(id: String) = write(AtomicFile(File(directory, "last-computer")), id.toByteArray())+ /** The computer whose lead "Talk to Codync" calls; none is Automatic. */+ fun shortcutLead(): String? = File(directory, "shortcut-lead").takeIf { it.exists() }?.readText()?.takeIf { it.isNotBlank() }+ fun saveShortcutLead(id: String?) {+ if (id == null) File(directory, "shortcut-lead").delete() else write(AtomicFile(File(directory, "shortcut-lead")), id.toByteArray())+ }+fun setupComplete(): Boolean = File(directory, "setup-complete").exists()fun hasIdentity(): Boolean = File(directory, "identity").exists()fun completeSetup() = write(AtomicFile(File(directory, "setup-complete")), byteArrayOf(1))diff --git a/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.kt b/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.ktindex ff5b9012..64515e19 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/MainActivity.kt@@ -122,6 +122,12 @@ class MainActivity : ComponentActivity() {super.onStop()}private fun handle(intent: Intent?) {+ if (intent?.action == LiveShortcut.ACTION) { intent.action = null; accounts.talkToLead(); return }+ if (intent?.action == Intent.ACTION_SEND) {+ intent.getStringExtra(Intent.EXTRA_TEXT)?.takeIf { it.isNotBlank() }?.let { accounts.share(it.take(64 * 1024)) }+ intent.action = null+ return+ }val uri = intent?.data ?: returnintent.getStringExtra(NotificationDisplay.ALERT_KIND)?.let { category ->intent.removeExtra(NotificationDisplay.ALERT_KIND)diff --git a/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt b/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.ktindex 372919c0..eb32de50 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/MainTabs.kt@@ -11,6 +11,10 @@ import androidx.compose.foundation.layout.asPaddingValuesimport androidx.compose.foundation.layout.fillMaxSizeimport androidx.compose.foundation.layout.navigationBarsimport androidx.compose.foundation.layout.padding+import androidx.compose.foundation.background+import androidx.compose.foundation.layout.statusBarsPadding+import androidx.compose.material3.Text+import androidx.compose.ui.text.style.TextAlignimport androidx.compose.foundation.layout.Arrangementimport androidx.compose.foundation.layout.Columnimport androidx.compose.runtime.Composable@@ -91,15 +95,33 @@ private enum class AppTab { Bots, State, Settings }// A chat's entry names its computer and bot; it keeps its state while sliding away.var shown by remember { mutableStateOf<AppState?>(null) }if (open != null) shown = open- NavStack(listOfNotNull("roster", open?.let { "${it.computer.id}/${it.selectedBot}" }), key = { it }, pop = { accounts.openBot(null) }) { entry ->- if (entry == "roster") BotListView(app, states, accounts, account, manage, newBot, newGroup, edit, extensions, barSpace)- else (states.firstOrNull { "${it.computer.id}/${it.selectedBot}" == entry } ?: shown)?.let { chat(it) }+ NavStack(listOfNotNull("roster", open?.let { "${it.computer.id}/${it.selectedBot}" } ?: REMOVED_CHAT.takeIf { app.removedChat }),+ key = { it }, pop = { accounts.openBot(null) }) { entry ->+ when (entry) {+ "roster" -> BotListView(app, states, accounts, account, manage, newBot, newGroup, edit, extensions, barSpace)+ REMOVED_CHAT -> RemovedComputer { accounts.openBot(null) }+ else -> (states.firstOrNull { "${it.computer.id}/${it.selectedBot}" == entry } ?: shown)?.let { chat(it) }+ }}}Box(Modifier.fillMaxSize().tabLayer(tab == AppTab.State)) {StateScreen(app, states.firstOrNull { it.computer.id == app.currentComputerId }?.usage, accounts, usage, barSpace, active = tab == AppTab.State)}- Box(Modifier.fillMaxSize().tabLayer(tab == AppTab.Settings)) { SettingsView(app, accounts, barSpace) }+ Box(Modifier.fillMaxSize().tabLayer(tab == AppTab.Settings)) { SettingsView(app, accounts, barSpace, states) }+ }+}++private const val REMOVED_CHAT = "removed"++/** In place of a chat whose computer was removed meanwhile (iOS `ChatScreen`'s empty state). */+@Composable private fun RemovedComputer(back: () -> Unit) {+ Column(Modifier.fillMaxSize().background(Palette.background).statusBarsPadding()) {+ ScreenHeader(leading = { BackButton(back) })+ Column(Modifier.fillMaxSize().padding(24.dp), horizontalAlignment = Alignment.CenterHorizontally,+ verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically)) {+ Symbol("desktopcomputer.trianglebadge.exclamationmark", size = 48.dp, tint = Palette.tertiary)+ Text(tr("This computer was removed"), style = Type.title3.semibold, color = Palette.text, textAlign = TextAlign.Center)+ }}}diff --git a/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.kt b/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.ktindex c09058d8..a1582fd4 100644--- a/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.kt+++ b/apps/android/app/src/main/kotlin/com/codync/android/SettingsView.kt@@ -35,7 +35,7 @@ import com.codync.android.design.** analytics, Start over; iOS `SettingsView`). Each computer's own settings (voice chat, push, connection,* hidden bots) are in Computer management (`ComputersView`).*/-@Composable internal fun SettingsView(state: AccountContext, store: AccountStore, bottomInset: Dp) {+@Composable internal fun SettingsView(state: AccountContext, store: AccountStore, bottomInset: Dp, computers: List<AppState> = emptyList()) {val uri = LocalUriHandler.currentvar confirmStartOver by remember { mutableStateOf(false) }var aboutAnalytics by remember { mutableStateOf(false) }@@ -56,6 +56,7 @@ import com.codync.android.design.*}}ThinkingDetailsSettings()+ ShortcutLeadSettings(state, computers, store)NotificationsSection()CardSection(footer = "Which features you use, never your messages, code or files. Helps us spot bugs sooner and make Codync better for you.") {row {diff --git a/apps/android/app/src/main/res/values/widget.xml b/apps/android/app/src/main/res/values/widget.xmlindex c3014802..3abea089 100644--- a/apps/android/app/src/main/res/values/widget.xml+++ b/apps/android/app/src/main/res/values/widget.xml@@ -1,5 +1,7 @@<?xml version="1.0" encoding="utf-8"?><resources>+ <!-- The app icon's shortcut that calls the lead bot (the iPhone's Siri phrase). -->+ <string name="talk_shortcut">Talk to Codync</string><string name="widget_loading">Codync · Open the app for the latest report</string><string name="widget_bots_description">Latest bot status and unread counts</string><string name="widget_team_description">Four bots as characters, the ones that need you first</string>diff --git a/apps/android/app/src/test/kotlin/com/codync/android/ShortcutLeadTest.kt b/apps/android/app/src/test/kotlin/com/codync/android/ShortcutLeadTest.ktnew file mode 100644index 00000000..fc35722a--- /dev/null+++ b/apps/android/app/src/test/kotlin/com/codync/android/ShortcutLeadTest.kt@@ -0,0 +1,22 @@+package com.codync.android++import com.codync.android.core.Bot+import com.codync.android.core.Computer+import org.junit.Assert.assertEquals+import org.junit.Assert.assertNull+import org.junit.Test++class ShortcutLeadTest {+ private fun computer(id: String, vararg bots: Bot) = AppState(Computer(id, id, id), loading = false, bots = bots.toList())+ private val mac = computer("mac", Bot("a", "Mac helper"), Bot("lead-mac", "Mac lead", lead = true))+ private val linux = computer("linux", Bot("lead-linux", "Linux lead", lead = true))++ @Test fun `talk to codync calls the picked computer's lead, else the first computer's in the list`() {+ assertEquals("lead-linux", shortcutLead(listOf(mac, linux), "linux")?.second?.id)+ assertEquals("lead-mac", shortcutLead(listOf(mac, linux), null)?.second?.id)+ // A picked computer whose lead is gone falls back to Automatic.+ assertEquals("lead-linux", shortcutLead(listOf(computer("mac", Bot("a", "Helper")), linux), "mac")?.second?.id)+ assertEquals("lead-mac", shortcutLead(listOf(linux.copy(bots = listOf(Bot("lead-linux", "Gone", lead = true, deleted = true))), mac), null)?.second?.id)+ assertNull(shortcutLead(listOf(computer("mac", Bot("a", "Helper"))), null))+ }+}diff --git a/docs/features/ios-shortcuts.md b/docs/features/ios-shortcuts.mdindex 578fadf9..0b329087 100644--- a/docs/features/ios-shortcuts.md+++ b/docs/features/ios-shortcuts.md@@ -17,4 +17,4 @@ The text action uses the existing message path, including nonce-based retry andThe adapter lives in the iOS app (`BotShortcuts` and `AppStore+Shortcuts`); the account-scoped entity query lives in CodyncKit. CodyncUI reuses BotStore's sending and connection logic and delivers a one-shot voice request to ThreadView. A pending shortcut send retains its target connection across background transitions, then releases it after acceptance, failure or cancellation; active calls retain their own connection. Both actions wait for account restoration before resolving the target, since an intent can run before the scene restores the account. The host continues to own message handling and agent work; the lead comes from the cached bots (`lead` in their JSON), and there is no new host method or compatibility-floor change for the shortcuts.-This is an iOS system integration. Desktop already offers bot selection, text sending and voice calls in ThreadView/CallView; Android exposes the same existing functions through ChatScreen and its call bar. Neither client runs iOS App Intents. The terminal UI retains its existing bot selection and message sending and has no microphone voice UI. Their shared behavior and layouts are unchanged.+This is an iOS system integration. Desktop already offers bot selection, text sending and voice calls in ThreadView/CallView. Android has its own counterparts (`LiveShortcut.kt`): **Talk to Codync** in the app icon's shortcuts calls the lead like Open Live Mode without a bot (Settings → Shortcuts → Lead to call picks it, as on the iPhone), and text shared from another app opens the picked bot's chat with the text in its box, like Send Text to Bot with Open Chat on. Neither client runs iOS App Intents. The terminal UI retains its existing bot selection and message sending and has no microphone voice UI. Their shared behavior and layouts are unchanged.diff --git a/docs/plans/android-app.md b/docs/plans/android-app.mdindex a9c395ff..37cfbf87 100644--- a/docs/plans/android-app.md+++ b/docs/plans/android-app.md@@ -69,14 +69,13 @@ on one emulator, 2026-10-31).`AttachmentFiles.kt`).- **Pull to refresh** on the roster and in Computer management uses the chat's indicator; iOS uses the system one.- **`computers` / `plugins` links** open over the current tab; iOS switches to Bots first.-- **Shortcuts actions** (Open Live Mode, Send Text to Bot) are an Apple App Intents integration with no- Android counterpart ([iOS Shortcuts](../features/ios-shortcuts.md)).+- **Shortcuts actions** (Open Live Mode, Send Text to Bot) are Apple App Intents; Android's counterparts are+ **Talk to Codync** in the app icon's shortcuts (the lead, by Settings → Shortcuts → Lead to call) and text shared+ from another app, which opens the picked bot's chat with the text in its box ([iOS Shortcuts](../features/ios-shortcuts.md), `LiveShortcut.kt`).- **On-device voice**: languages other than English need Android 13+ and Android's on-devicerecognizer; it never falls back to online recognition (iOS may use Apple's servers).- **Jump to latest** is an opaque disc: it sits in the scrolling content, so there's no blur under it.-- **A removed computer's open chat** closes with it; the iPhone shows *This computer was removed* in its place.- **Dictation on device** stops at a pause, like the iPhone's; Android's recognizer runs on the phone where it can (it tries the phone's own speech service once when that one lacks the language), otherwise the phone's own speech service.-- **Shortcuts' lead** (Settings → Shortcuts → Lead to call) is part of the Apple-only Shortcuts actions.## Before a Play releasediff --git a/web/content/docs/bots.mdx b/web/content/docs/bots.mdxindex 4849a1b7..1d4a3feb 100644--- a/web/content/docs/bots.mdx+++ b/web/content/docs/bots.mdx@@ -14,7 +14,7 @@ You set it up and arrange it like any bot: name, avatar, agent, folder, connecto**Pick your own lead.** Any other bot can take the role: touch and hold it on the iPhone or Android, or right-click it on the desktop, and choose **Make lead agent** (in the terminal, select it and press `*`). The star, the calls and shortcuts that name no bot, and speaking first move to it; the bot that led before becomes an ordinary bot again and keeps its routines, Check in included. You can also delete the lead like any bot. Codync doesn't make a new one; until you pick another, Open Live Mode asks which bot to call.-**More than one computer.** Each computer has its own lead. On the iPhone, Siri, the Action button and Open Live Mode without a bot call the lead of the first computer in your list. To call another one, go to **Settings → Shortcuts → Lead to call** and pick it.+**More than one computer.** Each computer has its own lead. On the iPhone, Siri, the Action button and Open Live Mode without a bot call the lead of the first computer in your list; on Android, **Talk to Codync** in the app icon's shortcuts does. To call another one, go to **Settings → Shortcuts → Lead to call** and pick it.## How a bot runsdiff --git a/web/content/docs/conversations.mdx b/web/content/docs/conversations.mdxindex aa4c9be7..6ff5c21a 100644--- a/web/content/docs/conversations.mdx+++ b/web/content/docs/conversations.mdx@@ -32,6 +32,8 @@ If a message fails to send, it shows **Failed to send** with buttons to resend oOn iPhone, sending clears the message box so you can type your next message. You can add text with dictation or switch to another chat's saved draft.+**From another app (Android):** share text to Codync, pick a bot, and its chat opens with the text in the message box, after anything you had typed there. Nothing is sent until you send it.+**From Shortcuts (iPhone):** Codync's **Send Text to Bot** action sends a message without typing it in the chat. Pick a **Bot** and fill in **Text**. **Open Chat** is off by default, so the message goes out in the background; turn it on to open the chat. The action finishes when the computer accepts the message, or reports it queued when the computer is offline. The iPhone has to be unlocked, also from Siri ("Send text with Codync"). Only the current account's visible bots are listed.## Filesdiff --git a/web/content/docs/voice.mdx b/web/content/docs/voice.mdxindex 0e1aa4d7..2d3554fa 100644--- a/web/content/docs/voice.mdx+++ b/web/content/docs/voice.mdx@@ -32,6 +32,10 @@ On Android, the call's notification shows the same: the call's state and what thIn the Shortcuts app, add Codync's **Open Live Mode** action and pick a **Bot**, or leave it empty to call your lead bot, whichever bot you made the lead; if you have none, it asks which bot. With a lead on more than one computer, it calls the first computer's, or the one you pick in **Settings → Shortcuts → Lead to call**. Running it opens that bot's chat and starts a call. Siri runs it too: say "Talk to Codync" or "Open Live Mode in Codync" to call your lead bot. The computer has to be online; otherwise the action stops with an error instead of starting a call.+### From the app icon (Android)++Touch and hold the Codync icon and choose **Talk to Codync**: it opens your lead bot's chat and starts a call, like Open Live Mode without a bot. With a lead on more than one computer, it calls the first computer's, or the one you pick in **Settings → Shortcuts → Lead to call**. With no lead, it opens Bots so you can pick one; a computer that can't be reached shows an error instead of starting a call.+## Choose a voice engineOpen **Voice chat** settings from the call bar's gear, or: