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(ios): add an in-app switch for push notifications
leepokaieed9ac0dab55
diff --git a/apps/ios/App/Push.swift b/apps/ios/App/Push.swiftindex cb42718d..23e58793 100644--- a/apps/ios/App/Push.swift+++ b/apps/ios/App/Push.swift@@ -95,6 +95,13 @@ final class PushRegistrar {func didRegister(token: Data) {deviceToken = token+ resync()+ }++ /// The in-app switch; off asks every computer to stop alerting this phone.+ static var enabled: Bool { UserDefaults.standard.object(forKey: "notificationsEnabled") as? Bool ?? true }++ func resync() {for entry in stores.values { if let store = entry.store { syncDevice(with: store) } }}@@ -103,6 +110,15 @@ final class PushRegistrar {let id = store.computer.idstores[id] = WeakStore(store: store)LiveActivities.shared.resume(with: store)+ guard Self.enabled else {+ registrations[id]?.cancel()+ registrations[id] = Task { [weak store] in+ do { try await store?.client?.unregisterDevice() } catch {+ log.error("device unregistration failed: \(error.localizedDescription)")+ }+ }+ return+ }guard let token = deviceToken else {Task {let settings = await UNUserNotificationCenter.current().notificationSettings()diff --git a/apps/ios/Views/SettingsView.swift b/apps/ios/Views/SettingsView.swiftindex 6ff2cef4..3a1cc257 100644--- a/apps/ios/Views/SettingsView.swift+++ b/apps/ios/Views/SettingsView.swift@@ -13,6 +13,7 @@ struct SettingsView: View {@Environment(\.dismissModal) private var dismissModal@Environment(\.openURL) private var openURL@State private var notificationsAllowed: Bool?+ @AppStorage("notificationsEnabled") private var notificationsEnabled = true@State private var addingComputer = false@State private var confirmForget: Computer?@State private var confirmRevoke: CloudComputer?@@ -73,6 +74,9 @@ struct SettingsView: View {}CardSection("Notifications", footer: "Get a result summary, a request for input, or a failure notice. Notification previews follow your iOS settings.") {+ Toggle("Push notifications", isOn: $notificationsEnabled)+ .toggleStyle(.codync)+ .onChange(of: notificationsEnabled) { PushRegistrar.shared.resync() }notificationsRow}diff --git a/docs/design/push-and-live-activity.md b/docs/design/push-and-live-activity.mdindex d135d630..d418e74a 100644--- a/docs/design/push-and-live-activity.md+++ b/docs/design/push-and-live-activity.md@@ -17,7 +17,7 @@ The encrypted title is limited to 80 characters and the body to 400 characters.Notification actions open the scoped conversation. Permission approval still requires the normal in-app permission card. An account mismatch does not navigate into another account. Notifications are grouped by computer plus bot. Muted and hidden bots do not alert. The existing host-wide suppression while an iOS event connection is open remains in place; independent foreground suppression for multiple phones is not implemented.-Use Settings → Notifications to request access or open the iOS notification settings, including when access is already enabled. Per-bot notification preferences remain in the bot editor. State → Live Activity controls automatic activity creation and shows system authorization. Turning it off ends this phone's activities.+Use Settings → Notifications to switch push notifications off for this iPhone (the app calls `unregisterDevice`, so every computer drops its alert ticket; Live Activities are unaffected), and to request access or open the iOS notification settings. Per-bot notification preferences remain in the bot editor. State → Live Activity controls automatic activity creation and shows system authorization. Turning it off ends this phone's activities. State → Dynamic Island shows the same switch: iOS renders one activity in both places and offers no island-only opt-out. The expanded island centers the bot name and current step under the camera, between the avatar and the orb (both vertically centered), so no text reaches the island's 44 pt corners.## Responsibilities and privacydiff --git a/docs/reference/remote-relay.md b/docs/reference/remote-relay.mdindex 02eae8b3..749f4c19 100644--- a/docs/reference/remote-relay.md+++ b/docs/reference/remote-relay.md@@ -311,7 +311,7 @@ blob = epk(32) ‖ sig(64) ‖ ct| loopback 專用 | `setScreenEnabled`, `pairing`, `computerCall`, `teamCall`, `claimSign`, `unclaim`, `devices`, `revokeDevice`, `accessRequests`, `decideAccessRequest`, `cloudStatus`, `setCloud` | `Caller::Local`(loopback + token) || 配對中 | `pair` | 只在 pairing 狀態的 channel;配對完成後不可再呼叫 || screen scope | `screenOffer`, `screenClose`, `screenTakeover` | Local,或 scopes 含 `screen` 的裝置 |-| control scope | 其餘所有既有方法(`hello`, `sync`, `history`, `createBot`, `updateBot`, `deleteBot`, `markRead`, `send`, `stop`, `newSession`, `respondPermission`, `registerDevice`, `registerActivity`, `refreshBackends`, `usage`, `listDirs`, market/skills/connectors、`agentSetup`, `agentAuth`, `agentAuthenticate`, `setAgentEnv`, `termInput`, `termResize`, `termClose`, `screenStatus`) | Local,或 scopes 含 `control` 的裝置 |+| control scope | 其餘所有既有方法(`hello`, `sync`, `history`, `createBot`, `updateBot`, `deleteBot`, `markRead`, `send`, `stop`, `newSession`, `respondPermission`, `registerDevice`, `unregisterDevice`, `registerActivity`, `refreshBackends`, `usage`, `listDirs`, market/skills/connectors、`agentSetup`, `agentAuth`, `agentAuthenticate`, `setAgentEnv`, `termInput`, `termResize`, `termClose`, `screenStatus`) | Local,或 scopes 含 `control` 的裝置 |v1 發出的 grant 一律 `["control","screen"]`。diff --git a/host/src/api/mod.rs b/host/src/api/mod.rsindex 0d3f65b8..3ee5c1d9 100644--- a/host/src/api/mod.rs+++ b/host/src/api/mod.rs@@ -410,6 +410,10 @@ pub async fn dispatch(hub: &Arc<Hub>, caller: &Caller, method: &str, b: Value) -hub.store.add_push_ticket(ticket, caller.device_key(), push_key, b["ctx"].as_str(), name)?;json!({})}+ "unregisterDevice" => {+ hub.store.remove_push_tickets(caller.device_key())?;+ json!({})+ }"registerActivity" => {let bot_id = str_arg(&b, "botId")?;let row = hub.store.bot(bot_id)?.filter(|row| !row.deleted).ok_or_else(|| anyhow!("unknown bot"))?;diff --git a/host/src/store.rs b/host/src/store.rsindex 700ed511..df88489e 100644--- a/host/src/store.rs+++ b/host/src/store.rs@@ -845,6 +845,13 @@ impl Store {Ok(())}+ /// Stops alerts to a device (its notification switch is off); Live Activity tickets stay.+ pub fn remove_push_tickets(&self, device_key: &str) -> Result<()> {+ let c = self.db.locked();+ c.execute("DELETE FROM push_tickets WHERE device_key = ?1", [device_key])?;+ Ok(())+ }+pub fn remove_push_ticket(&self, ticket: &str) -> Result<()> {let c = self.db.locked();// If the newest ticket for an identity is dead or superseded, do not fall backdiff --git a/kit/Sources/CodyncKit/Client/HostClient.swift b/kit/Sources/CodyncKit/Client/HostClient.swiftindex 1883b42b..4e58672e 100644--- a/kit/Sources/CodyncKit/Client/HostClient.swift+++ b/kit/Sources/CodyncKit/Client/HostClient.swift@@ -229,6 +229,11 @@ public extension HostClient {let _: Empty = try await call("registerDevice", Body(ticket: ticket, relay: relay, name: name, pushKey: pushKey, ctx: ctx))}+ /// Stops this device's alerts; used when notifications are switched off in the app.+ func unregisterDevice() async throws {+ let _: Empty = try await call("unregisterDevice")+ }+func registerActivity(botId: String, ticket: String) async throws {let _: Empty = try await call("registerActivity", ["botId": botId, "ticket": ticket])}